Temporal valid time constrain

Database
Enthusiast

Temporal valid time constrain

I have a temporal table , and I want to insert a new rows using a None temporal Insert statment , 

I can do this on TD vertual machine ( avaible at TD site) and It work find , 

But When I try to run the same code on real development environment , It show a constrain violation if end of validtime before Today and and Work Find if the End(validtime) is in future.

 

I believe that there is something wrong , because 

1. I use none temporal Insert statment , 

2. I did not define a constrain on table

3. The Code can run with no error in TD vertual machine.

 

I need to disable this constrain on my dev. env.

 

My code :

 

DROP TABLE Policy;
CREATE MULTISET TABLE Policy(
Policy_ID INTEGER,
Customer_ID INTEGER,
Validity PERIOD(DATE) NOT NULL AS VALIDTIME
)
PRIMARY INDEX(Policy_ID);

-- Will work correctly since end of period in future
INSERT INTO Policy
(Policy_ID, Customer_ID, Validity)
VALUES (1, 1,PERIOD(DATE '2009-10-01', DATE '2019-02-08'));

 

-- Will give an error since end of period is before today
INSERT INTO Policy
(Policy_ID, Customer_ID, Validity)
VALUES (2, 2,PERIOD(DATE '2009-10-01', DATE '2018-02-01'))
;
SELECT Policy.*,Validity
FROM Policy

 

 

2 REPLIES

Re: Temporal valid time constrain

any support please .

Teradata Employee

Re: Temporal valid time constrain

You say "I use none temporal Insert statment" but the NONTEMPORAL modifier applies to Transaction Time.

You should use NONSEQUENCED VALIDTIME INSERT ...