sql - Check future date in trigger -


i want launch trigger if user try replace current date future date.but subquery might not allowed in trigger. how can solve issue? suggestion....

  create or replace trigger check_join_date         before update of join_date on doctor         each row         when (new.join_date > (select current_date+1 dual) )     begin         raise_application_error(-20509,'do not enter future date..');     end check_join_date;     / 

i getting error after running code in oracle.

ora-02251: subquery not allowed here 

test this

create or replace trigger check_join_date         before update of join_date on doctor         each row         when (new.join_date > current_date+1)     begin         raise_application_error(-20509,'do not enter future date..');     end check_join_date;     / 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -