5. Embedded OpenSQL : Data Manipulation with Cursors : Opening a Cursor
 
Share this page                  
Opening a Cursor
Opening a cursor executes the associated SELECT statement and positions the cursor before the first row in the result table. To open a cursor, use the OPEN statement:
EXEC SQL OPEN cursor_name [FOR READONLY];
To specify that you intend to read the table without updating it, include the FOR READONLY clause. This clause may improve the performance of the cursor retrieval. If FOR READONLY is specified, updates cannot be performed on the data. FOR READONLY can be specified even if the cursor was declared for update.