Cursors and Temporal Queries | Temporal Table Support | Teradata Vantage - Cursors and Temporal Queries - Advanced SQL Engine - Teradata Database

Temporal Table Support

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
cjo1556732840654.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1182
lifecycle
previous
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.