(1) Write a PL/SQL block which display all employee name and salary using cursor.
declare
ename emp.empname%type;
sal emp.salary%type;
cursor employee is select empname,salary from emp;
open employee;
loop
fetch employee into ename,sal;
exit when employee%notfound;
dbms_output.put_line(ename || sal);
end loop;
close employee;
end;
No comments:
Post a Comment