CREATE OR REPLACE TRIGGER VEREFIE_PER BEFORE INSERT OR UPDATE OF DATEDEBUT,DATEFIN ON Intervenants FOR EACH ROW DECLARE ROM INTERVENTIONS%ROWTYPE; BEGIN IF(INSERTING) THEN SELECT * INTO ROM FROM INTERVENTIONS WHERE NUMINTERVENTION =:NEW.NUMINTERVENTION; IF((ROM.DATEDEBINTERV <= :NEW.DATEDEBUT) AND (ROM.DATEFININTERV>= :NEW.DATEFIN )) THEN DBMS_OUTPUT.PUT_LINE('PERIODE VALIDE'); ELSE RAISE_APPLICATION_ERROR(-20658,'PERIODE INVALIDE '); END IF; ELSE SELECT * INTO ROM FROM INTERVENTIONS WHERE NUMINTERVENTION= :NEW.NUMINTERVENTION; IF((ROM.DATEDEBINTERV <= :NEW.DATEDEBUT) AND (ROM.DATEFININTERV>= :NEW.DATEFIN )) THEN DBMS_OUTPUT.PUT_LINE('PERIODE VALIDE'); ELSE RAISE_APPLICATION_ERROR(-20658,'PERIODE INVALIDE'); END IF; END IF; END; /