17.10 - Example: Creating a System-Time Table - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - ANSI Temporal Table Support

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1186-171K
Language
English (United States)

The following example creates a system-time table and includes the system versioning clause, which is required to make the table a temporal table.

CREATE MULTISET TABLE employee_system_time (
 eid INTEGER NOT NULL,
 name VARCHAR(10)NOT NULL,
 deptno INTEGER NOT NULL,
 sys_start TIMESTAMP(6) WITH TIME ZONE NOT NULL 
           GENERATED ALWAYS AS ROW START,
 sys_end TIMESTAMP(6) WITH TIME ZONE NOT NULL 
           GENERATED ALWAYS AS ROW END,
 PERIOD FOR SYSTEM_TIME(sys_start, sys_end)
 )
 PRIMARY INDEX (eid) WITH SYSTEM VERSIONING;