ALLBASE/SQL Reference Manual (36216-90216)

Chapter 10 381
SQL Statements A - D
DELETE WHERE CURRENT
DELETE WHERE CURRENT
The DELETE WHERE CURRENT statement deletes the current row of an active set. The
current row is the row pointed to by a cursor after the FETCH or REFETCH statement is
issued.
Scope
Application Programs
SQL Syntax
DELETE FROM {[
Owner.
]
TableName
[
Owner.
]
ViewName
} WHERE CURRENT OF
CursorName
Parameters
[
Owner
.]
TableName
designates the table from which you are deleting a row.
[
Owner
.]
ViewName
designates a view based on a single table. ALLBASE/SQL finds the
row of the base table corresponding to the row of the view indicated by the
cursor, and deletes the row from the base table. Refer to the CREATE VIEW
statement for restrictions governing modifications via a view.
CursorName
specifies the name of a cursor. The cursor must be open and positioned on a
row of the table. The DELETE WHERE CURRENT statement deletes this row,
leaving the cursor with no current row. (The cursor is said to be positioned
between the preceding and following rows of the active set). You cannot
use the cursor for further updates or deletions until you reposition it using
a FETCH statement, or until you close and reopen the cursor.
Description
This statement cannot be used interactively.
Although the SELECT statement associated with the cursor may specify only some of
the columns in a table, the DELETE WHERE CURRENT statement deletes an entire row.
The DELETE WHERE CURRENT statement can be used on an active set associated with a
cursor defined using the FOR UPDATE clause.
Do not use this statement in conjunction with rows retrieved using a BULK FETCH.
Using the DELETE statement with the WHERE CURRENT OF CURSOR clause
requires that the cursor be defined on the basis of an updatable query. See
"Updatability of Queries" in the "SQL Queries" chapter.
The target table of the DELETE WHERE CURRENT statement is specified with
TableName
or is the base table underlying
ViewName
. The base table restrictions that
govern deletions via cursors are presented in the description of the DECLARE CURSOR
statement.