How You Can Close a Cursor
When the program has processed all the required rows in the result table, close the cursor. Closing a cursor:
• Sets the cursor's State attribute to CS_CLOSED
• Makes changes visible to the rest of the program (if the cursor was a deferred update cursor)
• Releases any locks held by the select statement associated with the cursor (if autocommit is on)
If you reopen a closed cursor, the cursor is repositioned at the top of the result table.
The following statement provides an example of closing a cursor:
close cust_cursor;
In addition to being closed explicitly by the close statement, cursors are also closed implicitly when the variable representing them goes out of scope. For example, if the cursor object is referenced by a variable declared locally to a frame and the frame closes without explicitly closing the cursor object, the cursor object is closed automatically.