15.00 - ROLLBACK (Temporal Form) - Teradata Database

Teradata Database Temporal Table Support

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

ROLLBACK (Temporal Form)

Purpose  

Terminates and rolls back the current transaction.

Syntax  

Note: Temporal Table Support describes syntax that is especially relevant to temporal tables. Syntax that is not required, or that is not otherwise specific to temporal tables is generally not shown in this manual. For additional syntax, see SQL Data Definition Language, SQL Data Manipulation Language, and SQL Data Control Language.

Note: To ensure application portability to future ANSI standards for temporal SQL, Teradata recommends explicit specification of all temporal qualifiers.

 

Syntax Element …

Specifies …

CURRENT VALIDTIME

that only rows that are currently valid participate in the evaluation of the abort condition.

At least one table referenced in the statement must have valid time.

VALIDTIME AS OF
date_timestamp_expression

a given time that must overlap the valid time of a row for that row to participate in the evaluation of the abort condition.

At least one table referenced in the statement must have valid time.

date_timestamp_expression can be a constant, scalar UDF, scalar subquery, or business calendar function that evaluates to a date or timestamp value.

SEQUENCED VALIDTIME

a period of applicability that must overlap the period of validity of a row for that row to participate in the evaluation of the abort condition.

For more information see “Sequenced Valid-Time Queries” on page 147.

period_expression

the period of applicability for the DML statement.

The period of applicability must be a period constant expression that does not reference any columns, but can reference parameterized values and the TEMPORAL_DATE or TEMPORAL_TIMESTAMP built-in functions.

The period of applicability can also be a self-contained noncorrelated scalar subquery that is always nonsequenced in the time dimensions regardless of the temporal qualifier for the DML statement.

Note: If a period_expression is specified, the valid-time column cannot be specified or referenced anywhere in the query. If the valid-time column is a derived period column, the component columns cannot be specified or referenced anywhere in the query.

If period_expression is omitted, the period of applicability defaults to PERIOD'(0001-01-01, UNTIL_CHANGED)' for a PERIOD(DATE) valid-time column or PERIOD '(0001-01-01 00:00:00.000000+00:00, UNTIL_CHANGED)' for a PERIOD(TIMESTAMP(n) WITH TIME ZONE) valid-time column, where precision n and WITH TIME ZONE are optional.

NONSEQUENCED VALIDTIME

that rows that participate in the evaluation of the abort condition are not further evaluated for qualification in the valid-time dimension.

At least one table referenced in the statement must have valid time.

AND

a keyword for specifying both a valid-time qualifier and a transaction-time qualifier.

CURRENT TRANSACTIONTIME

that only rows that are open participate in the evaluation of the abort condition.

At least one table referenced in the statement must have transaction time.

TRANSACTIONTIME AS OF date_timestamp_expression

a given time that must overlap the transaction time of a row for that row to participate in the evaluation of the abort condition.

At least one table referenced in the statement must have transaction time.

NONSEQUENCED TRANSACTIONTIME

that rows that participate in the evaluation of the abort condition are not further evaluated for qualification in the transaction-time dimension.

At least one table referenced in the statement must have transaction time.

AS OF date_timestamp_expression

that only rows that overlap date_timestamp_expression in the valid-time and transaction-time dimension participate in the evaluation of the abort condition.

WORK

an optional keyword.

'message'

the text of the message to be returned when the transaction is terminated.

FROM option

the temporal tables that are further qualified in the WHERE clause.

WHERE abort_condition

an expression where the result must evaluate to TRUE for Teradata Database to roll back the transaction.

Omitting a Valid-Time Qualifier

If no temporal qualifier is specified in the valid-time dimension in the statement, the system uses the temporal qualifier of the session. If none is explicitly specified for the session, the default of CURRENT is assumed and only rows that are currently valid participate in further processing.

Omitting a Transaction-Time Qualifier

If no temporal qualifier is specified in the transaction-time dimension in the statement, the system uses the temporal qualifier of the session. If none is specified for the session, the default of CURRENT is assumed and only rows that are open participate in further processing.

Temporal Qualifier and Subqueries

The temporal qualifier of a statement applies to all subqueries; no separate temporal qualifier is allowed for a subquery.

Related Information

 

For more information on...

See...

ROLLBACK statement

SQL Data Manipulation Language

FROM clause syntax and usage

“FROM Clause (Temporal Form)” on page 160