declare scrollable cursor

Description

Declares a scrollable cursor.

Syntax

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

Parameters

cursor sensitivity

Declares a cursor semi-sensitive or insensitive.

cursor scrollability

Declares a cursor scrollable or non-scrollable.

NoteA scrollable cursor does not use fetch loops but rather single fetch calls. Only non-scrollable and forward-only cursors use fetch loops.

Examples

Example 1

	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.

Usage

See also

scroll fetch, open