I am creating a table with date
column. I would like to add a check constraint to validate if the date is in future.
create table test_table (
schedule_date date not null,
check (schedule_date >= TODAY)
);
Above sql gives me a syntax error.
09:43:37 [CREATE - 0 row(s), 0.000 secs] [Error Code: -201, SQL State: 42000] A syntax error has occurred.
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]
How do I add a constraint on date column?