DELETE (Positioned Form) | Teradata Vantage - DELETE (Positioned Form) - Teradata Vantage - Analytics Database

SQL Stored Procedures and Embedded SQL

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-10-30
dita:mapPath
frc1628111662093.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
rjx1472253414573
lifecycle
latest
Product Category
Teradata Vantageā„¢

Deletes the most current fetched row from an updatable cursor invocation.

ANSI Compliance

ANSI/ISO SQL:2011-compliant.

This form is not valid in Teradata session mode.

Required Privileges

You must have the DELETE privilege on the table.

Use care when granting the privilege to delete data through a view. Data in fields that might not be known to the user is also deleted when a row is deleted through a view.

Invocation

Executable.

Stored procedures and embedded SQL.

Syntax

{ DELETE | DEL } FROM table_name WHERE CURRENT OF cursor_name

Syntax Elements

table_name
The name of the table in which the row to be deleted is found.
cursor_name
The name of the cursor to be used to position to the row to be deleted.

Usage Notes

  • The preprocessor TRANSACT or -tr option must be set to ANSI.
  • The WHERE CURRENT OF clause enables a DELETE statement to act on a row currently pointed to by the cursor named in WHERE CURRENT OF cursor_name.
  • Restrictions on Using WHERE CURRENT OF
    • cursor_name must be a valid updatable cursor.
    • Multiple updates of the current row of cursor or updates followed by a delete of the current row of cursor are allowed.
    • table_name must be the same table that you SELECT in the updatable cursor request.
    • You must position the referenced cursor at a valid row via the FETCH statement.

Example: Deleting a Row with a Cursor

In this example, the name of the cursor being used to delete from the table is X01.

EXEC SQL
DELETE FROM customer
WHERE CURRENT OF x01;

Related Information

  • Teradata Vantageā„¢ - SQL Data Manipulation Language, B035-1146