Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to check last row of a cursor

518838Jun 11 2007 — edited Jun 11 2007
Hi,
I'm having a cursor for loop like below:

for rec_cur in(select a,b,c from abc) loop
...
...
end loop;

If the above loop, I wanna check if the record I'm processing on, is last record or not (or simply I want to know the total rows fetched by cursor).

for rec_cur in(select a,b,c from abc) loop
...
if (on last record) then
do 'x';
else
do 'y';
end if;
end loop;

Please help me to achieve the required action.

Thanks
Deepak
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 9 2007
Added on Jun 11 2007
11 comments
7,478 views