## RVY_UPDATE_ABSENCES

Doc
Details
Grants
References
Dependencies
Code

TEXT
    PROCEDURE RVY_UPDATE_ABSENCES(
       n_num_matiere NUMBER,
       n_num_groupe NUMBER,
       n_num_promo NUMBER,
       n_debut DATE,
       n_fin DATE,
       n_num_etudiant NUMBER
    ) IS
       n_num_creneau NUMBER;
       n_ok_etudiant NUMBER;
    BEGIN

       SELECT
          C.NUM INTO n_num_creneau
       FROM
          RVY_CRENEAUX C
       WHERE
          C.NUM_MATIERE=n_num_matiere AND
          C.NUM_GROUPE=n_num_groupe AND
          C.NUM_PROMO=n_num_promo AND
          C.DEBUT=n_debut AND
          C.FIN=n_fin;

       SELECT
          COUNT(*) INTO n_ok_etudiant
       FROM
          RVY_SEANCES
       WHERE
          NUM_CRENEAU=n_num_creneau AND
          NUM_ETUDIANT=n_num_etudiant;

       IF n_ok_etudiant=1 THEN

          BEGIN
             INSERT INTO
                ETUDIANTS_ABSENCES
             VALUES(
                n_num_etudiant,
                n_num_creneau,
                'anj'
             );
          EXCEPTION
             WHEN OTHERS THEN null;
          END;

          BEGIN
             INSERT INTO
                RVY_SEANCES_BACKUP
             VALUES (
                n_num_matiere,
                n_num_groupe,
                n_num_promo,
                n_debut,
                n_fin,
                n_num_etudiant
             );
          EXCEPTION
             WHEN OTHERS THEN null;
          END;

       END IF;

    EXCEPTION
       WHEN OTHERS THEN null;
    END;