Code Listing 4: Creating a self-managing analyze_data procedure

 1  CREATE OR REPLACE PROCEDURE analyze_data
 2  IS
 3    l_employee_levels employee_level_qp.employee_level_rc;
 4    l_one_level employee_level%ROWTYPE;
 5  BEGIN
 6    l_employee_levels := employee_level_qp.allrows_CV;
 7    LOOP
 8      FETCH l_employee_levels INTO l_one_level;
 9      EXIT WHEN l_employee_levels%NOTFOUND;
10        ... /*process data*/ ...
11    END LOOP;
12    CLOSE l_employee_levels;
13 END;