DELETE (positioned) statement [ESQL] [SP]

Description

Deletes the data at the current location of a cursor.

Syntax

DELETE [ FROM table-spec ]
WHERE CURRENT OF cursor-name

Parameters

cursor-name:

identifier | hostvar

table-spec:

owner.]correlation-name

owner:

identifier

Examples

Example 1

The following statement removes the current row from the database:

DELETE WHERE CURRENT OF cur_employee

Usage

This form of the DELETE statement deletes the current row of the specified cursor. The current row is defined to be the last row fetched from the cursor.

The table from which rows are deleted is determined as follows:

The positioned DELETE statement can be used on a cursor open on a view as long as the view is updatable.

Changes effected by positioned DELETE statements are visible in the cursor result set, except where client-side caching prevents seeing these changes.

Standards

Permissions

Must have DELETE permission on tables used in the cursor.

See also

DECLARE CURSOR statement [ESQL] [SP]

INSERT statement

UPDATE statement

UPDATE (positioned) statement [ESQL] [SP]

sp_iqcursorinfo procedure in Chapter 7, “System Procedures” in Reference: Building Blocks, Tables, and Procedures