Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: howto traverse an associative array
On Fri, 19 Dec 2003 21:21:55 +0100, "Neil W. James"
<neilNONSPAM_at_familyjames.com> wrote:
>There's probably a better construction, but it's done like this:
>
> which := continent_population.FIRST;
> FOR i IN 1 .. continent_population.COUNT
> LOOP
> dbms_output.put_line('which :'||which);
> which := continent_population.NEXT(which);
> END LOOP;
> dbms_output.put_line(continent_population.COUNT);
Change this line:
> FOR i IN 1 .. continent_population.COUNT
to
WHILE which IS NOT NULL
Eventually the call to NEXT will return NULL.
John
-- Photo gallery: http://www.pbase.com/john_russell/Received on Fri Dec 19 2003 - 22:22:23 CST