DECLARE CURSOR statement [ESQL] [SP]
490
An update to any column causes the warning/error, even if the column is not
referenced by the cursor. For example, a cursor on Surname and Initials
would report the update even if only the Birthdate column were modified.
These update warning and error conditions will not occur in bulk operations
mode (
-b database server statement line switch) when row locking is
disabled. See "Performance tips" on page 713 of the book ASA User’s Guide.
INSENSITIVE cursors A cursor declared INSENSITIVE has its
membership fixed when it is opened; a temporary table is created with a copy
of all the original rows. FETCHING from an INSENSITIVE cursor does not
see the effect of any other INSERT, UPDATE, or DELETE statement, or any
other PUT, UPDATE WHERE CURRENT, DELETE WHERE CURRENT
operations on a different cursor. It does see the effect of PUT, UPDATE
WHERE CURRENT, DELETE WHERE CURRENT operations on the same
cursor.
INSENSITIVE cursors make it easier to write an application that deals with
cursors, since you only have to worry about changes you make explicitly to
the cursor; you do not have to worry about actions taken by other users or by
other parts of your application.
INSENSITIVE cursors can be expensive if the result set contains many rows.
Also, INSENSITIVE cursors are not affected by ROLLBACK or
ROLLBACK TO SAVEPOINT; the ROLLBACK is not an operation on the
cursor that changes the cursor contents.
INSENSITIVE cursors meet the ODBC requirements for static cursors.
FOR statement-name Statements are named using the PREPARE
statement. Cursors can be declared only for a prepared SELECT or CALL.
FOR UPDATE | READ ONLY A cursor declared FOR READ ONLY may
not be used in an UPDATE (positioned) or a DELETE (positioned)
operation. FOR UPDATE is the default.
USING variable-name For use within stored procedures only. The
variable is a string containing a SELECT statement for the cursor. The
variable must be available when the DECLARE is processed, and so must be
one of the following:
♦ A parameter to the procedure. For example: