Inserting data into a bitemporal table
Inserting data into a bitemporal table is similar to inserting data into an application-period temporal table.
About this task
Procedure
To insert data into a bitemporal table, use the INSERT
statement to add data to the table.
For example, the
following data was inserted on January 31, 2010 (2010-01-31) to the
table created in the example in
Creating a bitemporal table.
INSERT INTO policy_info(policy_id, coverage, bus_start, bus_end)
VALUES('A123',12000,'2008-01-01','2008-07-01');
INSERT INTO policy_info(policy_id, coverage, bus_start, bus_end)
VALUES('A123',16000,'2008-07-01','2009-01-01');
INSERT INTO policy_info(policy_id, coverage, bus_start, bus_end)
VALUES('B345',18000,'2008-01-01','2009-01-01');
INSERT INTO policy_info(policy_id, coverage, bus_start, bus_end)
VALUES('C567',20000,'2008-01-01','2009-01-01');
Results
policy_info
table now contains the following
insurance coverage data. The sys_start
, sys_end
,
and ts_id
column entries are generated by the database
manager. The begin-column of a period is inclusive, while the end-column
is exclusive, meaning that the row with a bus_end
value
of 2008-07-01 does not have a BUSINESS_TIME period overlap with the
row that contains a bus_start
value of 2008-07-01.
policy_id | coverage | bus_start | bus_end | sys_start | sys_end | ts_id |
---|---|---|---|---|---|---|
A123 | 12000 | 2008-01-01 | 2008-07-01 | 2010-01-31- 22.31.33. 495925000000 |
9999-12-30- 00.00.00. 000000000000 |
2010-01-31- 22.31.33. 495925000000 |
A123 | 16000 | 2008-07-01 | 2009-01-01 | 2010-01-31- 22.31.33. 495925000000 |
9999-12-30- 00.00.00. 000000000000 |
2010-01-31- 22.31.33. 495925000000 |
B345 | 18000 | 2008-01-01 | 2009-01-01 | 2010-01-31- 22.31.33. 495925000000 |
9999-12-30- 00.00.00 .000000000000 |
2010-01-31- 22.31.33. 495925000000 |
C567 | 20000 | 2008-01-01 | 2009-01-01 | 2010-01-31- 22.31.33. 495925000000 |
9999-12-30- 00.00.00. 000000000000 |
2010-01-31- 22.31.33. 495925000000 |
The
hist_policy_info
history table remains
empty because no history rows are generated by an insert.
policy_id | coverage | bus_start | bus_end | sys_start | sys_end | ts_id |
---|---|---|---|---|---|---|