function overloading question
Date: 25 Feb 2002 08:07:32 -0800
Message-ID: <a6cb04db.0202250807.3ea0a389_at_posting.google.com>
I have a function that takes in a date and returns a date but now my
users wants it to take in a varchar2 and return a varchar2. I was
wondering if it is a good pratice to do it this way or not. All I did
was do a data_type conversion and then passed it to the original
function and returned the value. Like so
function A (d in date) return date
function A (v in varchar2) return varchar2
is
is
begin
--date manipulation
return d
end A;
foo date := to_date(v,'yyyymmdd');
begin
return to_char(A(foo), 'yyyymmdd');
end A;
or should I just recreate the entire function instead of making the call to the overloaded function basically twice. this only happens if they want a varchar2 input and output from the function.
Adam Received on Mon Feb 25 2002 - 17:07:32 CET