15.00 - CREATE RECURSIVE VIEW/REPLACE RECURSIVE VIEW (Temporal Forms) - Teradata Database

Teradata Database Temporal Table Support

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

CREATE RECURSIVE VIEW/REPLACE RECURSIVE VIEW (Temporal Forms)

Purpose  

Creates or replaces a recursive view definition involving temporal tables.

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.

 

Syntax Element …

Specifies …

view_name

the name of the recursive view.

database_name

the name of the database or user to contain view_name if something other than the current database or user.

user_name

column_name

the name of a view column. If more than one column is specified, list their names in the order in which each column is to be displayed for the view.

CURRENT VALIDTIME

that seed_statement is a current query in the valid-time dimension. The result set is a nontemporal table.

VALIDTIME AS OF date_timestamp_expression

that seed_statement retrieves rows where the period of validity overlaps the specified AS OF expression. The result set is a nontemporal table.

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

NONSEQUENCED VALIDTIME

that seed_statement is a nonsequenced query in the valid-time dimension. If period_expression is specified, the nonsequenced query produces a table with valid time; otherwise, the result set is a nontemporal table.

The result set for a valid-time table includes an extra column for the overlapped valid-time period. If the list of columns for the view does not provide a name for the extra column, the default name is “VALIDTIME”.

period_expression

the period of applicability for the nonsequenced query.

CURRENT TRANSACTIONTIME

that seed_statement or recursive_statement is a current query in the transaction-time dimension. The result set is a nontemporal table.

TRANSACTIONTIME AS OF date_timestamp_expression

that seed_statement or recursive_statement retrieves rows whose transaction-time period in the row overlaps the specified AS OF expression. The result set is a nontemporal table.

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

NONSEQUENCED TRANSACTIONTIME

that seed_statement or recursive_statement is a nonsequenced query in the transaction-time dimension. A nonsequenced query produces a nontemporal table as a result set.

AS OF date_timestamp_expression

that seed_statement or recursive_statement retrieves rows whose valid-time and transaction-time periods overlap the specified AS OF expression.

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

seed_statement

existing seed SELECT statement syntax for CREATE RECURSIVE VIEW or REPLACE RECURSIVE VIEW.

recursive_statement

existing recursive SELECT statement syntax for CREATE RECURSIVE VIEW or REPLACE RECURSIVE VIEW.

Seed Statement and Recursive Statement

All rules that apply to the temporal form of the SELECT statement are applicable for queries specified in recursive views.

If no temporal qualifier is specified for the view and the view references any temporal tables, the temporal qualifier defaults to the applicable session temporal qualifier.

The seed statement and the recursive statement must have compatible valid-time qualifiers.

Selecting from a Recursive View

A query that selects from a recursive view can specify a temporal qualifier that is different from the temporal qualifier of the SELECT statements in the view definition.

Related Information

 

For more information on...

See...

CREATE RECURSIVE VIEW
(regular form)

SQL Data Definition Language

CREATE VIEW (temporal form)

“CREATE VIEW, REPLACE VIEW (Temporal Forms)” on page 98

temporal table views

“Views on Temporal Tables” on page 213