Deletes the current row indicated by a cursor.
The row currently indicated by the cursor is deleted from the base table implied by the cursor definition.
The row indicated by the cursor is that retrieved by the most recent FETCH statement, see FETCH.
After the deletion, the cursor is no longer positioned on a row in the set defined by the cursor declaration. A FETCH statement is required to position the cursor on the next row in the set before another DELETE CURRENT or an UPDATE CURRENT statement can be executed.
See ALLOCATE CURSOR for a description of extended cursors.
If an extended-cursor-name is specified in a DELETE CURRENT statement, it specifies the name of a host variable whose value is the name of the cursor.
DELETE access to the table or view identified by table-name is required when the cursor used for the DELETE CURRENT statement is opened. If DELETE access is not held, the cursor may be opened but DELETE CURRENT statements will fail.
The DELETE CURRENT statement may not be used for read-only cursors.
A cursor cannot be identified by specifying extended-cursor-name in a procedural usage context.
In a procedural usage context, the DELETE CURRENT statement is only permitted if the procedure access-clause is MODIFIES SQL DATA, see CREATE PROCEDURE.
The table name given in the DELETE CURRENT statement must be the same as that specified in the FROM clause of the cursor declaration. If a synonym is used in one of the statements, the same synonym must also be used in the other.
If the table name addressed by the DELETE CURRENT statement is subject to any referential constraints, the delete operation must not create a situation where these constraints are violated. The effect of the delete operation on any referential constraints depends on the delete-rule in effect for each constraint, see CREATE TABLE for a description of the delete-rule options.
If an error occurs during execution of a DELETE CURRENT statement, the row is not deleted.
ExampleDELETE FROM mimer_store_web.sessions WHERE session_no = p_session_no;
YES Fully compliant.
Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40