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!

Associative Array, how to loop the records using its count ?

809543Mar 20 2013 — edited Mar 20 2013
In the Associative Array, how to loop the records using its count ? for example
declare
    type population is table of number index by varchar2(64);
    city_population population;   
begin
    city_population('Samillve') := 200;
    city_population('Lindenhurst') := 300;    
    
    for i in 1 .. city_population.count
    loop
        dbms_output.put_line(city_population(i)); -- compiler error
    end loop;
end;
/
This post has been answered by JustinCave on Mar 20 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 17 2013
Added on Mar 20 2013
3 comments
1,282 views