September 16, 2005 at 12:53 pm
I wrote a SP that contains a cursor. This cursor needs to use the SP parameter for the cursor query.
I had the error that said that parameter must be declared. Please help. Thanks a lot!!!
create procedure spr_test
@param1 int as
declare test_cursor cursor for
select emp_id, emp_name from employee where emp_id = @param1
.... -> got error as 'Must declare the variable @param1'
September 16, 2005 at 1:01 pm
Using your example I do not get an error when I run.
use pubs
create procedure spr_test
@param1 int
as
declare test_cursor cursor for
select emp_id, fname from employee where emp_id = @param1
-- CLOSE test_cursor
DEALLOCATE test_cursor
go
spr_test @param1 = 1
September 16, 2005 at 1:10 pm
Thanks, Ray M. I'm able to get it works after removes some t-sql commands lay between. I'm really appreciate your helps!!!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy