Closing cursors

Use the close statement to close an open cursor. The syntax for the close statement is:

exec sql [at connection] close cursor_name end-exec 

To reuse a closed cursor, issue another open statement. When you reopen a cursor, it points to the first row. Do not issue a close statement for a cursor that is not open or an error will result.