Chapter 9 SQL Statements
493
DECLARE CURSOR statement [T-SQL]
Use this statement to declare a cursor in a manner compatible with Adaptive
Server Enterprise.
DECLARE
cursor-name
… CURSOR FOR
select-statement
…[ FOR { READ ONLY | UPDATE } ]
cursor-name
:
identifier
select-statement
:
string
None.
None.
"DECLARE CURSOR statement" on page 488
Adaptive Server Anywhere supports a DECLARE CURSOR syntax that is
not supported in Adaptive Server Enterprise. For information on the full
DECLARE CURSOR syntax, see "DECLARE CURSOR statement" on
page 488.
This section describes the overlap between the Adaptive Server Anywhere
and Enterprise flavors of DECLARE CURSOR.
♦
SQL/92 Entry-level compliant. The FOR UPDATE and
FOR READ ONLY options are Transact-SQL extensions.
♦
Sybase There are some features of the Adaptive Server Enterprise
DECLARE CURSOR statement that are not supported in Adaptive
Server Anywhere.
♦ Adaptive Server Enterprise supports cursors opened for update of a
list of columns from the tables specified in the select-statement.
This is not supported in Adaptive Server Anywhere.
♦ In the Watcom-SQL dialect, a DECLARE CURSOR statement in a
procedure, trigger, or batch must immediately follow the BEGIN
keyword. In the Transact-SQL dialect, there is no such restriction.
♦ In Adaptive Server Enterprise, when a cursor is declared in a
procedure, trigger, or batch, it exists for the duration of the
procedure, trigger, or batch. In Adaptive Server Anywhere, if a
cursor is declared inside a compound statement, it exists only for
the duration of that compound statement (whether it is declared in a
Watcom-SQL or Transact-SQL compound statement).
Function
Syntax
Permissions
Side effects
See also
Description
Standards and
compatibility