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: best way to loop over string value character by character

Re: best way to loop over string value character by character

From: Holger Baer <holger.baer_at_science-computing.de>
Date: Fri, 02 Sep 2005 13:13:19 +0200
Message-ID: <df9c4h$lf6$1@news.BelWue.DE>


steph wrote:
> What's the best (most performant) way to loop over a string value
> character by character?
>
> We've implemented it like this:
>
> for i in 1 .. length(v_str) loop
> c:= substr(v_str,i,1);
> end loop;
>
> I wonder if there is a better way for this. Maybe by not calling
> substr(), something like this:
>
> for i in 1 .. length(v_str) loop
> c:= v_str[i];
> end loop;
>
> Is it (easily) possible to convert the string into an array (and loop
> over the array consequently)?
>
> thanks,
> stephan
>

The most performant way is to tell what you want to do. Perhaps there is a way without a loop.

Regards,
Holger Received on Fri Sep 02 2005 - 06:13:19 CDT

Original text of this message

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