5. Working with Embedded SQL : Data Manipulation with Cursors : Delete Data Using Cursors
 
Share this page                  
Delete Data Using Cursors
The cursor version of the DELETE statement has the following syntax:
EXEC SQL DELETE FROM tablename
         WHERE CURRENT OF cursor_name;
The DELETE statement deletes the current row. The cursor must be positioned on a row (as the result of a FETCH statement) before a cursor delete can be performed. After the row is deleted, the cursor points to the position after the row (and before the next row) in the set. To advance the cursor to the next row, issue the FETCH statement.
A cursor does not have to be declared for update to perform a cursor delete.