Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: howto traverse an associative array

Re: howto traverse an associative array

From: John Russell <netnews8_at_johnrussell.mailshell.com>
Date: Sat, 20 Dec 2003 04:22:23 GMT
Message-ID: <59j7uvkf9k0ut840sefvm3lgvnasot34do@4ax.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US