Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursors with parameters
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00696728
Message ID:
00696756
Views:
12
Somethink like this?
declare @state char(2)
declare @lname varchar(40), @fname varchar(20)

   SET @state = 'CA'

   DECLARE authors_cursor CURSOR FOR 
   SELECT au_lname, au_fname
   FROM authors 
   WHERE state = @state

   OPEN authors_cursor
   FETCH NEXT FROM authors_cursor INTO @lname, @fname
   WHILE @@FETCH_STATUS = 0
   BEGIN
      PRINT @fname + space(1) + @lname     
      FETCH NEXT FROM authors_cursor INTO @lname, @fname
   END
   CLOSE authors_cursor
   DEALLOCATE authors_cursor
>Hi!,
>
>Is it possible to declare cursors with parameters?, if it so, could someone tell me how to declare 'em and how to open 'em?
>
>Thanks in advance!
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform