Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Test 1 - Paramètres par défauts
- */
- DECLARE
- groupe_resultat groupes.refgroupe%TYPE;
- BEGIN
- groupe_resultat := GESTIONHISTORIQUES.RECHERCHE();
- DBMS_OUTPUT.PUT_LINE('RECHERCHE, groupe trouvé : ' || groupe_resultat);
- EXCEPTION
- WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(SQLERRM);
- END;
- /*
- Résultats :
- RECHERCHE, groupe trouvé : 2222
- */
- /*
- Test 2 - Paramètres explicites
- GESTIONHISTORIQUES.RECHERCHE('2005', 3);
- Résultats :
- RECHERCHE, groupe trouvé : 2321
- */
- /*
- Test 3 - Année d'étude invalide
- GESTIONHISTORIQUES.RECHERCHE('2005', 4);
- Résultats :
- ORA-20000: Année d'étude "4" invalide. Elle doit se trouver entre 1 et 3
- */
- /*
- Test 4 - Année scolaire invalide
- groupe_resultat := GESTIONHISTORIQUES.RECHERCHE('2020', 3);
- Résultats :
- ORA-20001: L'année scolaire 2020 est postérieure à l'année actuelle
- */
- /*
- Test 5 - Plusieurs résultats
- groupe_resultat := GESTIONHISTORIQUES.RECHERCHE('2006', 2);
- Résultats :
- ORA-20002: Plusieurs groupes correspondent aux critère de recherche
- */
- /*
- Test 6 - Aucun résultat
- groupe_resultat := GESTIONHISTORIQUES.RECHERCHE('2006', 1);
- Résultats :
- ORA-20003: Aucun groupe ne correspond aux critères de recherche
- */
- /*
- Test 7 - Année d'étude nulle
- groupe_resultat := GESTIONHISTORIQUES.RECHERCHE(NULL, 3);
- Résultats :
- ORA-20004: L'année d'étude ne peut pas être NULL
- */
- /*
- Test 8 - Année scolaire nulle
- groupe_resultat := GESTIONHISTORIQUES.RECHERCHE('2005', NULL);
- Résultats :
- ORA-20005: L'année scolaire ne peut pas être NULL
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement