Purpose
Valid-time table definitions can include primary key and unique constraints that prevent rows from having valid-time periods that overlap. A system-defined join index is created automatically for constraint checking during modifications to the table.
Syntax
Syntax Element |
Description |
column_list |
The column name or the comma-separated list of columns that serve as the primary key or uniqueness constraint for the table. |
valid_time_period |
The name of the valid-time derived period column. |
WITHOUT OVERLAPS |
Specifies that valid-time periods of the table rows cannot overlap. |
ANSI Compliance
This is ANSI SQL:2011 compliant.
Usage Notes
Example : Temporal Primary Key Constraint on a Valid-Time Table
CREATE MULTISET TABLE employee_vt_pk (
eid INTEGER NOT NULL,
ename VARCHAR(5) NOT NULL,
terms VARCHAR(5),
job_start DATE NOT NULL,
job_end DATE NOT NULL,
PERIOD FOR job_dur(job_start,job_end) AS VALIDTIME,
PRIMARY KEY(deptno, job_dur WITHOUT OVERLAPS)
)
PRIMARY INDEX (eid);