Total Pageviews

July 1, 2016

7/01/2016 07:58:00 AM
 declare
  2      cursor c_countEmps is select count(*) count, sum(sal) sum from emp;
  3      r_testRec c_countEmps%ROWTYPE;
  4  begin
  5      open c_countEmps;
  6      fetch c_countEmps into r_testRec;
  7      close c_countEmps;
  8      DBMS_OUTPUT.put_line('number of emps is:'||r_testRec.count);
  9      DBMS_OUTPUT.put_line('sum of emp salaries is:'||r_testRec.sum);
 10  end;
 11  /

0 comments:

Post a Comment