Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursors with parameters
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00696728
Message ID:
00696756
Vues:
11
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform