Updatable and Read-Only Cursors - Advanced SQL Engine - Teradata Database

SQL Stored Procedures and Embedded SQL

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
vqj1592443206677.ditamap
dita:ditavalPath
vqj1592443206677.ditaval
dita:id
B035-1148
lifecycle
previous
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.