Was this helpful?
OPEN CURSOR--Open a Cursor
Valid in: EQUEL
Opens a cursor for processing.
This statement has the following format:
## open cursor cursor_name [for readonly]
The open cursor statement opens a cursor for processing. A cursor must be opened before it can be used to retrieve, append, or delete rows.
The retrieve clause of a declare cursor statement is evaluated when the cursor is opened. After you open a cursor, it is positioned immediately prior to the first row of the result table. To advance the cursor and retrieve the first row, your application program must issue a retrieve cursor statement.
The for readonly clause indicates that, even though the cursor has been declared for update, it is being opened for reading only. Opening a cursor for readonly improves database access time. You cannot use a readonly cursor to append, update, or delete rows.
Different cursors can be open at the same time only within a multi-query transaction. The same cursor can be opened and closed any number of times in a single program. A cursor must be closed, however, before it can be reopened.
The cursor_name parameter must be a declared cursor.
Last modified date: 04/03/2024