Use the close statement to close an open cursor. The syntax for the close statement is:
exec sql [at connection] close cursor_name;
To reuse a closed cursor, issue another open statement. When you re-open 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.