loop
fetch s_cur into s_rec;
exit when s_cur%notfound;
dbms_output.put_line('id:'||s_rec.id||':name:'||s_rec.name);
end loop;
When you have fetched the last record and trying to fetch the next
s_cur%notfound
becomes true but before it has a chance to exit from loop you are outputting the last record once again.
No comments:
Post a Comment