Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: best way to loop over string value character by character
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
![]() |
![]() |