3. Statements : OpenROAD SQL Statements : Delete Statement : Cursor Version
 
Share this page                  
Cursor Version
The cursor version of the delete statement deletes the row to which the specified cursor is pointing. The cursor is specified in the "where current of" clause. The value of cursor_variable must be the name of a reference variable that points to an object of the CursorObject class. The table name that you specify in a cursor delete statement must match the name of the table that you specified in the cursor's open statement.
Before you can issue a delete statement for a cursor, you must first open the cursor and fetch a row. If you open the cursor for direct update, any deletions take effect immediately. If you open the cursor for deferred update, any deletions take effect when you close the cursor.
You must execute a cursor delete statement in the same DBMS session in which you opened the cursor.
A successful cursor delete statement sets the State attribute of the CursorObject to CS_NOCURRENT, indicating that the cursor is now inting to a position after the deleted row but before the next row. You must issue another fetch statement before issuing another delete statement (or an update statement). A successful delete cursor statement also sets the IIrowcount system variable to one.