September 23, 2002 at 12:09 pm
I am having trouble with a cursor declaration. I am trying to declare the cursor with a variable for the tablename, but for some reason, it's not working. Here is the code I'm using:
exec('DECLARE cSubList CURSOR local scroll FOR SELECT acct FROM ' +
@listtbl + ' WHERE listnum = ' + @list)
When I try to open the cursor, cSubList, I get the message: A cursor with the name 'cSubList' does not exist. Any ideas?
September 23, 2002 at 12:49 pm
You are using the keyword 'local'
quote:
I am having trouble with a cursor declaration. I am trying to declare the cursor with a variable for the tablename, but for some reason, it's not working. Here is the code I'm using:exec('DECLARE cSubList CURSOR local scroll FOR SELECT acct FROM ' +
@listtbl + ' WHERE listnum = ' + @list)
When I try to open the cursor, cSubList, I get the message: A cursor with the name 'cSubList' does not exist. Any ideas?
September 23, 2002 at 12:53 pm
Thanks! That worked!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply