declare cursor employeeCursor is select e.ename e.

sal from employee e; name varchar2(200); salary number(9,2); begin for c1 in (select avg(e.sal) avg_salary from employee e) loop dbms_output.put_line('------------------------'); dbms_output.put_line('average salary ' c1.avg_salary); end loop; open employeeCursor; fetch employeeCursor into name, salary; dbms_output.put_line(chr(13) chr(13)); dbms_output.put_line('EmployeeS'); dbms_output.put_line('------------------------'); while employeeCursor%FOUND loop dbms_output.put_line(name ' makes $' fetch employeeCursor into name, salary; end loop; close employeeCursor; end; salary);

Sign up to vote on this title
UsefulNot useful