User Tools

Site Tools


kurs:p_cursor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

kurs:p_cursor [2014/09/10 21:22] (current)
Line 1: Line 1:
 +<​code>​
 +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
 +</​code>​
kurs/p_cursor.txt ยท Last modified: 2014/09/10 21:22 (external edit)