ABAP Keyword Documentation → ABAP - Reference → Processing External Data → ABAP Database Accesses → Open SQL → Open SQL - Read Accesses → OPEN CURSOR
CLOSE CURSOR
Other versions: 7.31 | 7.40 | 7.54
Syntax
CLOSE CURSOR dbcur.
Effect
This statement closes the database
cursor and initializes the cursor variable dbcur
, with which the database cursor is linked. The cursor variable dbcur
is a
host variable that must be declared using
the special predefined data type cursor
and that was opened using the statement
OPEN CURSOR
or was assigned an open cursor.
Notes
- Since only a limited number of database cursors can be open simultaneously, you should close all database cursors no longer required.
-
Initializing a cursor variable using the
CLEAR
statement is not enough to close a database cursor. If the value of the cursor variable in the program is known, the database cursor can be further processed usingFETCH
. - Once a database cursor has been closed, it can no longer be accessed. Other cursor variables that were associated with the database cursor are not initialized, but become invalid and accessing them would raise an exception that can be handled.
-
The name of the host variable
dbcur
should be prefixed with the escape character@
.