CLOSE
The CLOSE statement closes an open cursor. Once closed, the cursor cannot be used for further processing.
The COMMIT, ROLLBACK, and DISCONNECT statements close all open cursors.
General format
EXEC SQL [ AT Database ]
 
  CLOSE Cursor-Name
 
END-EXEC
Syntax rules
1. Cursor-Name is a Nonnumeric Literal, as defined in the Definitions section in the Preface of this document.
General rules
1. Cursor-Name must be previously defined by a DECLARE statement.
2. Database identifies the active connection that will execute the query and must be previously defined using a Format 4 DECLARE statement.
Examples
Close cursor
exec sql close cust_cur end-exec