17.05 - Example: Sequenced Valid-Time Insert into a Valid-Time Table - Teradata Database

Teradata Vantage™ - Temporal Table Support

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
17.05
created_date
June 2020
category
Programming Reference
featnum
B035-1182-170K

Use a sequenced valid-time insert to insert history, current, or future rows into a valid-time table. A sequenced valid-time insert is similar to a conventional insert where the valid-time column is treated as any other column in the table.

Consider the same valid-time table as in the previous example. The following statements perform sequenced valid-time inserts into the Policy table.

   SEQUENCED VALIDTIME INSERT INTO Policy
      VALUES (232540, 909234455, 'BM', 'STD-CH-344-YYY-00',
         PERIOD (DATE '1999-01-01', DATE '1999-12-31'));

   SEQUENCED VALIDTIME INSERT INTO Policy
      (Policy_ID, Customer_ID, Policy_Type, Policy_Details, Validity)
      VALUES (944540, 344567123, 'BM', 'STD-PL-332-YXY-01',
         PERIOD (DATE '2007-02-03', DATE '2008-02-02'));