Example: UPDATE on an ANSI Valid-Time Table Where the PA of Update Overlaps a Portion of the PV of the Row - Analytics Database - Teradata Vantage

ANSI 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
jqu1628112571823.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esa1472244798285
lifecycle
latest
Product Category
Teradata Vantage™

Temporal tables allow you to modify rows for only a portion of their period of validity. The database takes care of adding rows and adjusting valid-time periods to account for the change automatically. The database automatically handles the valid-time modifications for the row, which may involve changing the period bounds and adding new rows to the table.

For example, assume the company promotes Alice from employment terms TW10 to PW11 after she has been working for a year. Modifying the Alice row for only that portion of the row period of validity automatically yields two rows for Alice in the table:

UPDATE employee_vt
FOR PORTION OF job_dur FROM DATE'2005-12-01' TO DATE'9999-12-31'
SET terms='PW11'
WHERE ename='Alice';

SELECT * FROM employee_vt WHERE ename=’Alice’;

Output:

eid ename terms    job_start     job_end
---- ----- ----- ----------- -----------
1005 Alice PW11   2005/12/01  9999/12/01
1005 Alice TW10   2004/12/01  2005/12/01

Now the table has two rows for Alice that show how the terms of her employment changed, and the temporal extent of when she worked under each of the terms.