0

I'm working on a some Create Table statements for a project I have. I have two columns (StartDate, EndDate) where the data type is Timestamp. One of the requirements is to ensure that the date is fixed (January 1, 2000) but leave the time variable. How would I go about including that in my Create Table statement?

0

Try something like

CREATE TABLE test_stmp(StartDate TIMESTAMP NOT NULL,
constraint chk_test_filed check(trunc(StartDate) = to_date('2000-01-01','yyyy-mm-dd')));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.