> 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]

Reply via email to