5. Embedded OpenSQL : Data Manipulation with Cursors : Closing Cursors
 
Share this page                  
Closing Cursors
The final action in cursor processing is to close the cursor. Once the cursor is closed, no more processing can be performed with it unless another OPEN statement is issued.
The syntax for closing the cursor is as follows:
EXEC SQL CLOSE cursor_name;
The same cursor can be opened and closed any number of times in a single program, but it must be closed before reopening it. If a cursor is closed and reopened, the associated select statement is executed again and the cursor is positioned before the start of the result rows.