i notice on forums and documentation that order of declarations in DB2 needs to be Vars, Conditions, Cursor, Handler. Added to these i have a global temp table. i have tried out several combinations.
#1. For Vars, Cursor, GlobalTempTable, Handler, i get the error: An unexpected token "<handler declaration>" was found following "". Expected tokens may include:"<SQL statement>". LINE NUMBER=21. SQLSTATE=42601
#2. For Vars, GlobalTempTable, Cursor, Handler,
i get the error: An unexpected token "<cursor declaration>" was found following "". Expected tokens may include: "<SQL statement>". LINE NUMBER=15. SQLSTATE=42601
#3. For Vars, Cursor, Handler, GlobalTempTable,
i get the error: SQL0204N ... is an undefined name at the line where i am trying to make an INSERT on it.
#4. in the absence of handler, globalTT works fine and vice versa. i have run out of sane combinations and cant find info on forums. i must be doing something infinitely stupid here but cant figure what that might be....
Can someone please help?
Thanks a lot.
#1. For Vars, Cursor, GlobalTempTable, Handler, i get the error: An unexpected token "<handler declaration>" was found following "". Expected tokens may include:"<SQL statement>". LINE NUMBER=21. SQLSTATE=42601
#2. For Vars, GlobalTempTable, Cursor, Handler,
i get the error: An unexpected token "<cursor declaration>" was found following "". Expected tokens may include: "<SQL statement>". LINE NUMBER=15. SQLSTATE=42601
#3. For Vars, Cursor, Handler, GlobalTempTable,
i get the error: SQL0204N ... is an undefined name at the line where i am trying to make an INSERT on it.
#4. in the absence of handler, globalTT works fine and vice versa. i have run out of sane combinations and cant find info on forums. i must be doing something infinitely stupid here but cant figure what that might be....
Can someone please help?
Thanks a lot.