Unanswered: SQLSTATE=25001 error on the first call statement
I have written some coding on db2 c express windows on one system. After that I have taken the backup & restored on other machine.From the second machine, if am trying to call a procedure.Which is giving me the below error;
db2 => call SP_proc1('MGGHL','QRYYOQY','TUET',1000);
SQL0428N The SQL statement is only allowed as the first statement in a unit
of work. SQLSTATE=25001
Can some one please let me know , what is this about?
Every one of your sprocs should catch exceptions, and report the details (for example into a table or dbms_output)
So each sproc should have a 'declare exit handler for sqlexception' which includes a 'get diagnostics exception...' and then report the results, and then use 'signal sqlstate...' to throw the exception to the caller.
That will make it easier to find programming errors.