I do not know why your code did not work.
I use executeImmediate to do what you try to do and I know that works.
executeImmediate
public static CSpDBResult executeImmediate(CSpDataSourceRef dataSourceRef,
String sqlQuery)
Parameters:
dataSourceRef - A reference to the data source name where the query is to be executed.
query - The query to execute
Returns:
The result of the query execution
"Pham, Tuan A" <[EMAIL PROTECTED]> wrote:
>> Hi,
>> I wanted to test overrid an entire Update query without using default
>> functions. It gave errors:
>>
>> MyProject.pgTableUpdate.FAiled Update!!!: Unexpected Exception
>> (java.lang.NullPointerException) caught in
>> pgTableUpdate(a MyProject.pgTableUpdate) [Parent: 'MyProject'(a
>> MyProject.MyProject)]. Top of stack:
>> |java.lang.NullPointerException at
>> MyProject.pgTableUpdate.Update_onWebEvent(pgTableUpdate.java:42) at
>>
>> The same SQL statement runs OK in ISQL. Do you know what problem it could
>> be ?
>>
>> Thanks for any help.
>> Tuan Pham
>>
>> Following is the code:
>>
>> public int Update_onWebEvent(CSpWebEvent event)
>> {
>> CSpMultiSQL doTableUpdate =
>> (CSpMultiSQL)
>> CSpider.getDataObject("doTableUpdate");
>> int command = PROCEED;
>> try
>> {
>> // Please note that the following technique
>> could be used on any
>> // Multi-SQL Data Object regardless of its type
>> doTableUpdate .setSqlTextOverrideUpdate
>> (CSpSQLObject.FULL_TEXT_OVERRIDE);
>>
>> String sql = "UPDATE table_a SET col1 = 'A' WHERE
>> row_id = 1000";
>> doTableUpdate .setSqlTextFullUpdate (sql);
>> command = doTableUpdate .executeUpdate ();
>> if ((command == PROCEED) && doTableUpdate .succeeded
>> ())
>> {
>> command = load ();
>> }
>> }
>> catch (Exception ex)
>> {
>>
>> CSpLog.exception (this, "FAiled Update!!!", ex);
>> }
>> finally
>> {
>> // Always restore the text override so as not
>> to create side effects
>> doTableUpdate .setSqlTextOverrideUpdate
>> (CSpSQLObject.NO_TEXT_OVERRIDE);
>> doTableUpdate .setSqlTextFullUpdate ("");
>> }
>>
>> return (command);
>> }
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]