Re: ouch
From: Neil Jonkers <njonkers_at_uwc.ac.za>
Date: Wed, 31 Aug 2011 23:13:27 +0200
Message-Id: <4E5EC017.6D1F.00D9.0_at_uwc.ac.za>
Hi Stephan
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?
Date: Wed, 31 Aug 2011 23:13:27 +0200
Message-Id: <4E5EC017.6D1F.00D9.0_at_uwc.ac.za>
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-lReceived on Wed Aug 31 2011 - 16:13:27 CDT