This content has been marked as final. Show 4 replies
You should use fully year qualifier yyyy
or doy can check the DateOfBirth column with sysdate
ADD constraint CHECK(sysdate - DateOfBirth>17)
hey thanks 4 ur reply ive tried both suggestions but i get the same error msg from both:
ora-02438: colum check constraint cannot reference other colums
use in you insert Statment this format TO_DATE( 'birthdate', 'DD-mm-yyyy' ) is a DATE.
Never depend on your NLS_DATE_FORMAT setting
Just try Converting to char and Just check...
I got this working.....
ALTER TABLE Table_Name ADD CONSTRAINT
cons_ch CHECK ( TO_CHAR(Col_Name,'YYYY') >'2012');