PL/SQL Cursor to Display Record from One Number to Another

PL/SQL Cursor to Display Record from One Number to Another:

declare 
cursor rec_print is select * from emp;
frno number;
upto number;
cnt number;
begin
cnt:=1;
frno:=:frno;
upto:=:upto;
for i in rec_print
loop
if(cnt>=frno and cnt<=upto) then
dbms_output.put_line(i.empno||' '||i.ename||' '||i.job||' '||i.sal);
end if;
cnt:=cnt+1;
end loop;
end;

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.