L3 Info : SGBD
 
◃  Ch. 12 Oracle PL/SQL  ▹
 

Traitement complet d'un curseur explicite

DECLARE
   v_liv_num livre.liv_num%TYPE;
   v_liv_titre livre.liv_titre%TYPE;
   CURSOR cursLivre IS SELECT liv_num, liv_titre FROM livre ORDER BY liv_num;
BEGIN
   OPEN cursLivre;
   LOOP 
   FETCH cursLivre INTO v_liv_num, v_liv_titre;
   EXIT WHEN (cursLivre%NOTFOUND);
   
   ...
   
   END LOOP;
   CLOSE cursLivre;
END;