Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

db2 - order of declarations

Status
Not open for further replies.

saltbits

Programmer
Jun 1, 2004
27
US
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top