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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PLSQL: variable in FOR loop

Re: PLSQL: variable in FOR loop

From: michel <you_at_somehost.somedomain>
Date: Tue, 04 Aug 1998 23:00:44 GMT
Message-ID: <woMx1.1413$Uq2.1751349@weber.videotron.net>


first : no more then one value in your variable, second : no need for parentheses with your loop

In article <35c6051d.7289401_at_gateway.northgrum.com>, iluvpets_at_iname.com says...
>
>The following code is a simple loop that works as advertised:
>FOR cnty IN (SELECT DISTINCT country FROM cities ORDER BY 1)
>LOOP
> .. do some stuff ..
>END LOOP;
>
>I need to make the SQL a touch dynamic, so I tried the following:
>vSQL VARCHAR2(100);
>BEGIN
>vSQL := 'SELECT DISTINCT country FROM cities ORDER BY 1';
>FOR cnty IN (vSQL)
>LOOP
> .. do some stuff ..
>END LOOP;
>
>And I get the following:
>PLS-00103: Encountered the symbol "LOOP" when expecting one of the
>following: * & - + / mod rem .. an exponent (**) ||
>
>Ouch! Is this possible?
>Thanks very much
>Mark
>mark_aurit ATSIGN mail.northgrum.com
Received on Tue Aug 04 1998 - 18:00:44 CDT

Original text of this message

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