Step 6: Closing the cursor

 

If you have processed the rows of a result table using a serial cursor, and you want to use the cursor again, issue a CLOSE statement to close the cursor before opening it again.

The statement looks like this:

EXEC SQL  CLOSE cursor-name END-EXEC.

If you processed the rows of a result table and you do not want to use the cursor again, you can let the system close the cursor. The system automatically closes the cursor when:

 

Parent topic:

Examples: Using a cursor