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
DECLARE CURSOR statements in Transact-SQL procedures are treated as executable statements and can appear anywhere in a procedure. The cursor declaration takes effect when the statement is executed and remains in effect until a DEALLOCATE CURSOR statement is executed or until the procedure completes.
In SQL 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).
In a Transact-SQL procedure, trigger, or batch, a DECLARE CURSOR statement can appear after other executable statements.
None.
None.
SQL/2003 Core feature. The FOR UPDATE and FOR READ ONLY options are Transact-SQL extensions.
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |