Re: ouch

From: David Fitzjarrell <oratune_at_yahoo.com>
Date: Wed, 31 Aug 2011 14:33:53 -0700 (PDT)
Message-ID: <1314826433.68083.YahooMailNeo_at_web65415.mail.ac4.yahoo.com>



I did just that and posted to the list; the "time-saving" function performed 21 more recursive statements than the native function.  Wasteful in my book. David Fitzjarrell From: Neil Jonkers <njonkers_at_uwc.ac.za> To: Oracle L <oracle-l_at_freelists.org> Sent: Wednesday, August 31, 2011 2:13 PM Subject: Re: ouch Hi Stephan One approach would be to illustrate via autotrace. Reading from DUAL results in a Full Table Scan if the database version is prior to  10 g. Regards Neil >>> "Uzzell, Stephan" <SUzzell_at_MICROS.COM> 08/31/11 10:31 PM >>> Found a gem in one of my databases today: FUNCTION                        "SUBSTRING" (INSTRING IN varchar2, STARTPOS IN number, LENGTH  IN number) RETURN varchar2 IS   RESULT varchar2(8000); BEGIN select substr(INSTRING, STARTPOS, LENGTH) into RESULT from DUAL; RETURN(RESULT); END; I'm offended by the sheer aesthetics of this. And I want to go yell at the developers that this is wrong. But I'd need a better argument than that it offends me. Is there some way to quantify the impact (if any) of wrapping a built-in function like this? Stephan Uzzell All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/emaildisclaimer -- http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
Received on Wed Aug 31 2011 - 16:33:53 CDT

Original text of this message