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: for loop in PL/SQL

Re: for loop in PL/SQL

From: Steve Halko <steveh_at_redshift.com>
Date: Mon, 30 Aug 1999 00:35:05 -0700
Message-ID: <rskd2ur8j7173@corp.supernews.com>


If your varchar2 values are sequential (or at least able to be calculated from the loop index), then you can use the integer loop index to compute the varchar2 values within the loop:

for count 65..90 --ASCII values for 'A' thru 'Z' loop
MyCharacter := CHR(count); --Convert loop count to a character end loop;

Nandakumar <N.Kumar_at_rocketmail.com> wrote in message news:7q4jsa$g8j$1_at_nnrp1.deja.com...
>
>
> Is there a way in PL/SQL to loop thru' a varchar2 list.
>
> Currently, the following snippet of code
>
> for count 1..5
> loop
> end loop; is valid in PL/SQL; count being an integer.
>
> i want to do similar thing with a list of varchar2 fields like
>
> for value in 'A' 'B' 'C'
> loop
> end loop;
>
> how can i do this? Any suggestions???
>
>
> thanks
> Nanda
>
>
>
>
>
>
>
> --
> Nandakumar
> (N.Kumar_at_rocketmail.com)
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Received on Mon Aug 30 1999 - 02:35:05 CDT

Original text of this message

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