RE: ouch

From: Goulet, Richard <Richard.Goulet_at_parexel.com>
Date: Fri, 2 Sep 2011 14:57:33 +0000
Message-ID: <7642C3D639A75E4284658CAA38BF60A4027CBB_at_US-BOS-VEX001.eu.pxl.int>



Stephan,
                Obviously this is wrong and is something that should be brought up to the developers' manager(s).  It is said that the software industry has something like a man century of backlog to work on and no wonder when people are re-inventing that which is already built.  The argument that you'll get is that it's a more informative function call which is therefore self-documenting, bull.  Now if they wanted to do more than just sub string a character string, that's another issue, like maybe left or right padding it to a fixed length.

Richard Goulet
Senior Oracle DBA/Na Team Leader

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Uzzell, Stephan Sent: Wednesday, August 31, 2011 4:32 PM To: Oracle L
Subject: ouch

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

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Sep 02 2011 - 09:57:33 CDT

Original text of this message