Declares a scrollable cursor.
EXEC SQL DECLARE <curs_name> [ <cursor sensitivity> ] [ <cursor scrollability> ] CURSOR FOR <cursor specification> <cursor sensitivity> : : = SEMI_SENSITIVE | INSENSITIVE <cursor scrollability> : : = SCROLL | NO SCROLL <cursor specification> : : = <select statement> [ <updatability clause> ] <updatability clause> : : = FOR {READ ONLY | UPDATE [ OF <column name list> ]} END-EXEC
Declares a cursor semi-sensitive or insensitive.
Declares a cursor scrollable or non-scrollable.
A scrollable cursor does not use fetch loops but rather
single fetch calls. Only non-scrollable and forward-only cursors
use fetch loops.
EXEC SQL DECLARE c1 INSENSITIVE SCROLL CURSOR FOR
select title_id, royalty
from authors
where royalty < 25 END-EXEC.
EXEC SQL OPEN c1 END-EXEC.
If cursor sensitivity is specified as INSENSITIVE, SCROLL is not implied.
If cursor sensitivity is not specified as INSENSITIVE or SEMI_SENSITIVE, and SCROLL is also not specified in the declare cursor, the cursor is scrollable and read-only with the specified sensitivity.
If cursor sensitivity is not specified, the cursor is declared as non-sensitive, non-scrollable and read-only.
If cursor scrollability is specified as SCROLL, the cursor is INSENSITIVE.
If cursor scrollability is not specified, the default is NO SCROLL, and the cursor is declared as non-scrollable and read-only.
scroll fetch, open