DELETE Where Current of Cursor

Description

Deletes the row in which the cursor is positioned.

NoteDBMS-specific Not all DBMSs support DELETE Where Current of Cursor.

Syntax

DELETE FROM TableName WHERE CURRENT OF CursorName;

Parameter

Description

TableName

The name of the table from which you want to delete a row

CursorName

The name of the cursor in which the table was specified

Usage

The USING TransactionObject clause is not allowed with this form of DELETE Where Current of Cursor; the transaction object was specified in the statement that declared the cursor.

NoteError handling It is good practice to test the success/failure code after executing a DELETE Where Current of Cursor statement.

Examples

Example 1

This statement deletes from the Employee table the row in which the cursor named Emp_cur is positioned:

DELETE FROM Employee WHERE current of Emp_curs ;