The syntax for declaring a scrollable cursor is:
exec sql declare cursor_name [cursor sensitivity] [cursor scrollability] cursor
for select_statement ;
where:
cursor_name identifies the cursor. The name must be unique and have a maximum of 255 characters. The name must begin with a letter of the alphabet or with the symbols “#” or “_”.
cursor sensitivity specifies the sensitivity of the cursor. The options are:
semi_sensitive. If semi_sensitive is specified in the declare statement, scrollability is implied. The cursor is semi_sensitive, scrollable, and read-only.
insensitive. If insensitive is specified in the declare statement, the cursor is insensitive. Scrollability is determined by specifying SCROLL in the declare part. If SCROLL is omitted or NOSCROLL is specified, the cursor is insensitive only and non-scrollable. It is also read-only.
If cursor sensitivity is not specified, the cursor is non-scrollable and read-only.
cursor scrollability specifies the scrollability of the cursor. The options are:
scroll. If scroll is specified in the declare statement and sensitivity is not specified, the cursor is insensitive and scrollable. It is also read-only.
no scroll. If the SCROLL option is omitted or NOSCROLL is specified, the cursor is non-scrollable and read-only. See the previous cursor sensitivity description for cursor behavior.
If cursor scrollability is not specified, the cursor is non-scrollable and read-only.
select_statement is a select statement that can return multiple rows of data. The syntax for select is the same as described in the Adaptive Server Enterprise Reference Manual, except that you cannot use into or compute clauses.