Using a Select Cursor with a Collection Variable
About this task
A Collection cursor that includes a SELECT statement with the Collection- Derived Table clause provides access to the elements in a collection variable.
To select more than one element:
Procedure
Results
This DECLARE statement declares a Select cursor for a
collection variable:
EXEC SQL BEGIN DECLARE SECTION;
client collection set(integer not null) a_set;
EXEC SQL END DECLARE SECTION;
...
EXEC SQL declare set_curs cursor for select * from table(:a_set);
For an extended code example that uses a Collection cursor for a SELECT statement, see Fetching from a Collection Cursor.