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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -