Example: Creating a Sequenced View on a Temporal Table - 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™

The following statement creates a sequenced view on the Policy table. The result of the sequenced query is a valid-time table or view. The valid-time period for each row in the view is stored in a new column that is automatically appended by the system. The valid-time for each row in the view is the overlap of the valid-time period of the row in the original temporal table with the valid time of the sequenced query. Because a time period is not specified in the sequenced query, the period for the query defaults to (0001-01-01, UNTIL_CHANGED), and the valid-time periods in the view will match those for the original rows.

Because names for the view columns are not specified in the CREATE VIEW statement, the system assigns the new valid-time column the name VALIDTIME.

   CREATE VIEW Basic_Auto_Policy_V AS
   SEQUENCED VALIDTIME
   SELECT Policy_ID, Customer_ID
   FROM Policy
   WHERE Policy_Type = 'AU';