Re: function overloading question

From: Ranga Chakravarthi <ranga_at_removethis.cfl.rr.com>
Date: Thu, 28 Feb 2002 04:34:50 GMT
Message-ID: <Krif8.4325$1p6.1010586_at_typhoon.tampabay.rr.com>


You can overload a procedure/function by creating a package.

"Adam Hapworth" <hap_at_mikomi.org> wrote in message news: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
> is
> begin
> --date manipulation
> return d
> end A;
>
> function A (v in varchar2) return varchar2
> is
> 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 Thu Feb 28 2002 - 05:34:50 CET

Original text of this message