delete (cursor command)

Description

Using a cursor command, delete removes a row from a table. The row affected must have been made current by a read cursor.

Syntax

1. delete [[database.]owner.]{table_name | view_name}
2. delete [from] [[database.]owner.]{table_name|view_name}
 	where current of cursor_name

NoteAny valid object in the catalog can be substituted for table_name or view_name.

Parameters

from (after delete)

is an optional keyword used for compatibility with other versions of SQL. Follow it with the name of the table or view from which you want to remove rows.

where current of

is a standard where clause.

Examples

Example 1

declare c1 cursor for
 select * from tablea for update of col1
delete tablea where current of c1

Usage


The cursor can be reused multiple times before it is deallocated.