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!

difference between for and while loop

user13710379Jan 25 2012 — edited Jan 25 2012
hi,
is there any difference between the below FOR loop and WHILE loop? both seems to do the same work.
Please correct me if i'm wrong

for i in persons.First .. persons.Last loop
yourAssocArray(persons(i).ID) := persons(i).Name;
end loop;
----------------------------------------------

i := persons.First
while i is not null loop
yourAssocArray(persons(i).ID) := persons(i).Name;

i= persons.next;
end loop;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2012
Added on Jan 25 2012
6 comments
3,244 views