Try OpenEdge Now
skip to main content
SQL Reference
ESQL Reference : Embedded SQL : ESQL elements and statements : CLOSE
 
CLOSE
Closing a cursor changes the state of the cursor from open to closed.

Syntax

EXEC SQL CLOSE cursor_name ;

Parameter

cursor_name
An identifier named earlier in a DECLARE CURSOR statement and an OPEN CURSOR statement.

Notes

*Only a cursor in the open state can be set to the closed state.
*When a transaction ends, any cursors in the open state are automatically set to the closed state.
*When a cursor is in the closed state, you cannot perform FETCH, DELETE, or UPDATE operations using that cursor.
*It is good practice to close cursors explicitly.

Example

EXEC SQL CLOSE dyncur ;
EXEC SQL COMMIT WORK ;
* Authorization
* Related statements