Cursors and Temporal Queries | Temporal Table Support | Teradata Vantage - Cursors and Temporal Queries - Analytics Database - Teradata Vantage

Temporal Table Support

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

A cursor is a data structure that stored procedures and Preprocessor2 use at runtime to point to the result rows in a response set returned by an SQL query. Procedures and embedded SQL also use cursors to manage inserts, updates, execution of multistatement requests, and SQL macros.

The DML semantics described for temporal tables apply to DML associated with a cursor, with some limitations that relate to positioned (updatable) cursors:
  • Only the current form of positioned cursors is allowed. The SELECT statement specified in the iteration statement FOR, DECLARE CURSOR, and positioned DELETE and UPDATE statements must all be qualified as CURRENT.
  • A SELECT statement on a temporal table can open an updatable cursor if the statement conforms to all existing rules on updatable cursors.
  • A SELECT statement that opens an updatable cursor has the same syntax as described in SELECT/SELECT INTO (Temporal Forms) when the statement references a temporal table, but the FROM clause must not specify an AS OF clause in the transaction-time dimension.
  • A positioned DELETE must be a CURRENT delete, and must not specify an AS OF clause as part of the FROM clause.
  • A positioned UPDATE must be a CURRENT update.

Related Information

For more information on... See...
cursors Teradata Vantage™ - SQL Stored Procedures and Embedded SQL, B035-1148