## T_ABSENCES_JUSTIFIEES_2

Code
Dependencies
Details

SOURCE
    create or replace TRIGGER t_absences_justifiees_2
    BEFORE INSERT ON absences_justifiees
    FOR EACH ROW
    DECLARE
    BEGIN
    UPDATE etudiants_absences
    SET justification = 'aj'
    WHERE pf_groupe = :new.f_groupe
    AND (SELECT e.jour FROM edt e WHERE e.p_id = pf_edt)+1 BETWEEN to_char(:new.date_debut, 'D') AND to_char(:new.date_fin, 'D')
    AND (SELECT e.semaine FROM edt e WHERE e.p_id = pf_edt) BETWEEN to_char(:new.date_debut, 'WW') AND to_char(:new.date_fin, 'WW');
    END;