Author Message
PaulShepherd
Joined: Jan 26, 2006
Messages: 0
Offline
What is the proper process to change an existing DB Add records to a table? 
I have a db add that is working correctly, and the table has changed. I have added a new DBOP and now that the field has changed vrom VARCHAR to VARBINARY, it does not allow me to choose a variable to assign this field. 
Do I just open the .java dbop file, and add my own java code to add the VARBINARY data? 
ErikJohnson2
Joined: Jan 18, 2006
Messages: 0
Offline
Not quite sure I totally understand the question.

One of the limitations of the DD 3.0 DB editor is that after you have created a DBOP you cannot add/remove or 
modify columns that are part of the query/add/update/delete operation.

I would recommend that you redefine the database operation to include the new or updated table column.

NOTE: In 3.1 we are looking to support modifying DBOPs so you can add/remove/modify columns in an operation.
PaulShepherd
Joined: Jan 26, 2006
Messages: 0
Offline
And with the new field being of type VARBINARY, there doesnt seem to be any way in DD to use a local var to add the record to the table. Am I right that the only way is to modify the .java file with custom java code to insert data into a VARBINARY field? 
ErikJohnson2
Joined: Jan 18, 2006
Messages: 0
Offline
Ahh right.  No there is no way in DD currently to add binary or BLOB data to a database.  In fact, I think you may need to hand write the SQL.  
I don''t think you can use the DBOP editor to generate the code because it ties into the framework to execute the query, so adding your own Java code to the dbop java file 
will probably not work.

I think you need to add a Servlet node, and then override the servletImplementation() method, and then add the Java 
code to obtain a Connection to the DataSource and then create the SQL statement.
ErikJohnson2
Joined: Jan 18, 2006
Messages: 0
Offline
Check out the sample application "MyTroubleDesk" that was released with DD 3.0.16.

Look at the Java class flow/InsertCustMsgDB.java, which I think is doing something along the lines of what you are trying to do.
Go to:   
Mobile view