sql - How to add check constraint CHECK constraint to the APP_DATE column to make sure that all appointments are before 02/01/2012 -
alter table office
add constraint check_app_date check (app_date < ’02-01-2012’);
i have tried use above commands getting error. error @ line 2: ora-00911: invalid character
is correct way check constraint in sqlplus?
you're missing to_date function:
add constraint check_app_date check (app_date < to_date(’02-01-2012’,'dd-mm-yyyy'));
Comments
Post a Comment