15.00 - Cursors and Temporal Queries - Teradata Database

Teradata Database Temporal Table Support

prodname
Teradata Database
vrm_release
15.00
category
Programming Reference
featnum
B035-1182-015K

Cursors and Temporal Queries

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)” on page 137 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

    SQL Stored Procedures and Embedded SQL