User Tools

Site Tools


kurs:p_cursor
PROCEDURE P_CURSOR
   IS
   cursor  c_max_salary IS
    SELECT
     jobs.job_id,
     jobs.job_title,
     jobs.min_salary,
     jobs.max_salary
    FROM jobs
    ORDER BY jobs.max_salary DESC;

  jobs_rec jobs%ROWTYPE;


BEGIN
open c_max_salary;
    for i IN  1..9 Loop
     fetch c_max_salary INTO jobs_rec;
        dbms_output.put_line('Gefeuert wird'|| jobs_rec.job_title ||
                            'weil er' || jobs_rec.max_salary ||
                              'verdient');
     end loop;
     close c_max_salary;

END; -- Procedure
kurs/p_cursor.txt · Last modified: 2014/09/10 21:22 (external edit)