A select cursor that includes a SELECT statement with the
collection-derived table clause allows you to select many elements
from a collection variable.
To select elements, follow these steps:
- Create a client collection variable in your IBM®
Informix® ESQL/C program.
For more information, see Declaring collection variables and Manage memory for collections.
- Declare the select cursor for the collection variable
with the DECLARE statement and open this cursor with the OPEN statement.
- Fetch the element or elements from the collection variable
with the FETCH statement and the INTO clause.
- If necessary, perform any updates or deletes on the fetched
data and save the modified collection variable in the collection
column.
For more information, see Operate on a collection column.
- Close the select cursor with the CLOSE statement, and if
you no longer need the cursor, free it with the FREE statement.