DELETE (positioned) Statement [ESQL] [SP]

Deletes the data at the current location of a cursor.

Quick Links:

Go to Parameters

Go to Examples

Go to Usage

Go to Standards

Go to Permissions

Syntax

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

table-spec - (back to Syntax)owner.]correlation-name

cursor-name - (back to Syntax)
   identifier | hostvar

Parameters

(back to top)

Examples

(back to top)

Usage

(back to top)

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 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

(back to top)

  • SQL—The range of cursors that can be updated may contain vendor extensions to ISO/ANSI SQL grammar if the ANSI_UPDATE_CONSTRAINTS option is set to OFF.
  • SAP Sybase Database product—Embedded SQL use is supported by Open Client/Open Server. Procedure and trigger use is supported in SQL Anywhere.

Permissions

(back to top)

Requires DELETE privilege on tables used in the cursor.

Related reference
DECLARE CURSOR Statement [ESQL] [SP]
INSERT Statement
UPDATE Statement
UPDATE (positioned) Statement [ESQL] [SP]