Updatable and Read-Only Cursors - 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ā„¢

An updatable, or positioned, cursor is a cursor defined by the application for a query that can also used to update the results rows.

A cursor is updatable if there is at least one positioned DELETE or positioned UPDATE that references it inside the FOR loop.

You can use updatable and read-only cursors in stored procedures with the following exceptions:
Updatable Cursors Read-Only Cursors
Allowed only in ANSI transaction mode. Allowed in ANSI and Teradata transaction modes.
Positioned DELETE or UPDATE statements can be used. The table name in these statements must be the same as that used in the cursor specification.
  • A positioned UPDATE can execute multiple updates of the current row of the cursor.
  • A positioned DELETE can delete the current row of the cursor after multiple updates.
Positioned DELETE or UPDATE statements cannot be used.