I have been haggling with this (seemingly) simple stored procedure (In the left margin, I have provided line numbers where errors occur):
Replace PROCEDURE MyProc()
Declare cur1 Cursor with return only For
When I try to run this, I get the following error, between the two statements:
Missing/Invalid SQL statement'E(3707):Syntax error, expected something like an 'END' keyword between ';' and the 'Declare' keyword.'.
I have run the two processes individually, outside of a stored procedure, and they work. Please help explain this mysterious error. Thank you.