Sunday, 14 February 2016

Print Employee Information ALL using PL/SQL BLOCK using Cursor

Print Employee Information ALL using PL/SQL BLOCK using Cursor

declare

cursor c1 is select * from emp ;

e c1%rowtype;

begin
open c1;

dbms_output.put_line('Employeee Info');
dbms_output.put_line('==============');
dbms_output.put_line('EmpNo   EmpName  EmpSalary');
loop
fetch c1 into e;
exit when c1%notfound;
dbms_output.put_line(e.empno||'     '||e.ename||'     '||e.sal);
end loop;
close c1;
end;
/

No comments:

Post a Comment