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 -> PLSQL: variable in FOR loop

PLSQL: variable in FOR loop

From: Mark Aurit <iluvpets_at_iname.com>
Date: Mon, 03 Aug 1998 18:50:09 GMT
Message-ID: <35c6051d.7289401@gateway.northgrum.com>


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 Mon Aug 03 1998 - 13:50:09 CDT

Original text of this message

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