Re: How to use CURSOR with SELECT * ?
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 08/30/04
- Next message: Hai: "Re: EQUIVALENT OF INSTR ON SQL SERVER SYNTAX"
- Previous message: J. Joshi: "Re: Identifying Integers & Alphabets"
- In reply to: Harag: "Re: How to use CURSOR with SELECT * ?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 30 Aug 2004 18:07:16 +0200
On Mon, 30 Aug 2004 15:54:11 +0100, Harag wrote:
(snip)
>
>Cool thanks, I got Aarons post and marked it to keep.
>
>BTW... what is the LOCAL for - I can't find this in BOL.
>
>Thanks
>
>Al.
Hi Al,
It's described in the article about DECLARE CURSOR. Copied text below.
LOCAL
Specifies that the scope of the cursor is local to the batch, stored
procedure, or trigger in which the cursor was created. The cursor name is
only valid within this scope. The cursor can be referenced by local cursor
variables in the batch, stored procedure, or trigger, or a stored
procedure OUTPUT parameter. An OUTPUT parameter is used to pass the local
cursor back to the calling batch, stored procedure, or trigger, which can
assign the parameter to a cursor variable to reference the cursor after
the stored procedure terminates. The cursor is implicitly deallocated when
the batch, stored procedure, or trigger terminates, unless the cursor was
passed back in an OUTPUT parameter. If it is passed back in an OUTPUT
parameter, the cursor is deallocated when the last variable referencing it
is deallocated or goes out of scope.
GLOBAL
Specifies that the scope of the cursor is global to the connection. The
cursor name can be referenced in any stored procedure or batch executed by
the connection. The cursor is only implicitly deallocated at disconnect.
Note If neither GLOBAL or LOCAL is specified, the default is controlled
by the setting of the default to local cursor database option. In SQL
Server version 7.0, this option defaults to FALSE to match earlier
versions of SQL Server, in which all cursors were global. The default of
this option may change in future versions of SQL Server. For more
information, see Setting Database Options.
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Next message: Hai: "Re: EQUIVALENT OF INSTR ON SQL SERVER SYNTAX"
- Previous message: J. Joshi: "Re: Identifying Integers & Alphabets"
- In reply to: Harag: "Re: How to use CURSOR with SELECT * ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|