DELETE (positioned) statement [ESQL] [SP]
498
DELETE (positioned) statement [ESQL] [SP]
Use this statement to delete the data at the current location of a cursor.
DELETE [ FROM
table-spec
]
…WHERE CURRENT OF
cursor-name
cursor-name
:
identifier
|
host-variable
table-spec
: [
owner
.]
correlation-name
owner
:
identifier
Must have DELETE permission on tables used in the cursor.
None.
"UPDATE statement" on page 637
"UPDATE (positioned) statement" on page 641
"INSERT statement" on page 554
"PUT statement" on page 582
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:
♦ If no FROM clause is included, the cursor must be on a single table
only.
♦ If the cursor is for a joined query (including using a view containing a
join), then the FROM clause must be used. Only the current row of the
specified table is deleted. The other tables involved in the join are not
affected.
♦ If a FROM clause is included, and no table owner is specified, table-
spec is first matched against any correlation names.
♦ If a correlation name exists, table-spec is identified with the
correlation name.
♦ If a correlation name does not exist, table-spec must be
unambiguously identifiable as a table name in the cursor.
♦ If a FROM clause is included, and a table owner is specified, table-spec
must be unambiguously identifiable as a table name in the cursor.
♦ The positioned DELETE statement can be used on a cursor open on a
view as long as the view is updatable.
Function
Syntax
Permissions
Side effects
See also
Description