CREATE OR REPALCE TRIGGER minimun_age_check
BEFORE INSERT ON employee
FOR EACH ROW
BEGIN
IF ADD_MONTHS( :new.birth_date, 18*12) > SYSDATE
THEN
RAISE_APPLICATION_ERROR(-20001, 'Employees must at least eighteen years of age.');
END IF;
END;

posted on 2015-06-30 15:40  风灵ARCHER  阅读(192)  评论(0编辑  收藏  举报