Code Listing 3: Creating a typical analyze_data procedure

 1  CREATE OR REPLACE PROCEDURE analyze_data
 2  IS
 3     l_employee_levels employee_level_qp.employee_level_rc;
 4     l_empid integer;
 5     l_count integer;
 6     l_date date;
 7  BEGIN
 8     l_employee_levels := employee_level_qp.allrows_CV;
 9     LOOP
10        FETCH l_employee_levels INTO l_empid, l_count, l_date;
11        EXIT WHEN l_employee_levels%NOTFOUND;
12        ... process data ...
13     END LOOP;
14     CLOSE l_employee_levels;
15 END;