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 get last Record ior Total rows in For Loop Cursor ?

447577Apr 11 2010 — edited Apr 12 2010
Hi Friends

I would like to know , the last record in for loop cursor, i have the code in following format

cursor c1 is
select * from emp;

begin
for r1 in c1 loop

v_total_rec := ? ( i would like to know total rows in the cursor , say for example if cursor has 10 rows, i want10 into this variable )

v_count := v_count +1;

dbms_output.put_line(r1.emp_name);



end loop;
end;

Hope i am clear

Any suggestions?

Thanks
Ravi
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 10 2010
Added on Apr 11 2010
7 comments
2,158 views