Re: ouch

From: Jeremy Schneider <jeremy.schneider_at_ardentperf.com>
Date: Wed, 31 Aug 2011 22:49:24 -0500
Message-ID: <4E5F00C4.2050609_at_ardentperf.com>



IMHO, nobody has yet answered the obvious question though... if there is a requirement to have some kind of "substring()" fuction available until the day when all queries are updated, then what's the right way to do it? Can you just create it as a public alias pointing to substr? Is there any way to write it which preserves all features of using the substr function itself?
-Jeremy

On 8/31/2011 4:01 PM, Tim Gorman wrote:
> Stephan,
>
> If you want to demonstrate the utter wrongness of this, try...
>
> SQL> set timing on
> SQL> declare
> 2 v_str varchar2(1000);
> 3 begin
> 4 for i in 1..100000 loop
> 5 v_str := substring('This stinks',5,1);
> 6 end loop;
> 7 end;
> 8 /
>
> PL/SQL procedure successfully completed.
>
> Elapsed: 00:00:03.34
> SQL>
> SQL> declare
> 2 v_str varchar2(1000);
> 3 begin
> 4 for i in 1..100000 loop
> 5 v_str := substr('This stinks',5,1);
> 6 end loop;
> 7 end;
> 8 /
>
> PL/SQL procedure successfully completed.
>
> Elapsed: 00:00:00.02
>
> Gosh, after seeing that, I had to go rinse my brain out... blech!
>
> Hope this helps...
>
> -Tim

-- 
http://www.ardentperf.com
+1 312-725-9249

Jeremy Schneider
Chicago



--
http://www.freelists.org/webpage/oracle-l
Received on Wed Aug 31 2011 - 22:49:24 CDT

Original text of this message