Defines a cursor. Once declared, row sets for cursors are assigned by using the OPEN statement. (The DECLARE statement can also be used to define the name and type of local variables for a batch or procedure. For more information on variable declaration and assignment, see the DECLARE Statement.)
DECLARE cursor_name [INSENSITIVE] [SCROLL] CURSOR
FOR select_statement
[FOR {READ ONLY | UPDATE [OF column_list]}]
where
The keywords COMPUTE, COMPUTE BY, FOR BROWSE, and INTO are not allowed within the select_statement of a cursor declaration.
If DISTINCT, UNION, GROUP BY, and/or HAVING are used, one or more of the underlying tables does not have a unique index, an outer join is used, or a constant expression is included in the select_list, the cursor will be created as INSENSITIVE.