Tuesday, June 19, 2018

Using cursor display only NO,NAME of first three row using for loop - DBMS (Cursor)

declare
cursor abc is select no,name from empmaster;
rec empmaster.no%type;
rec1 empmaster.name%type;
begin
open abc;
for i in 1..3
loop
fetch abc into rec,rec1;
dbms_output.put_line(rec||' '||rec1);
end loop;
close abc;
end;

No comments:

Post a Comment