CLOSE is an executable command that can only be embedded in a host language. CLOSE cannot be dynamically prepared.
See Authorization under the DECLARE CURSOR command topic for the authorization required to use a cursor.
CLOSE cursor-name
| cursor-name: | Identifies the cursor opened by a DECLARE CURSOR command. |
The following example (in the C language) declares a cursor named deptemp using the EMPLOYEE table, and then closes the cursor:
EXEC SQL
DECLARE CURSOR deptemp FOR
SELECT * FROM employee
WHERE dept = :deptno
;....
EXEC SQL
CLOSE deptemp;
Description
A CLOSE command is checked for all syntactical elements. The cursor must have been previously declared relative to the source program line in which CLOSE is encountered.