Re: function overloading question

From: srivenu <srivenu_at_hotmail.com>
Date: 25 Feb 2002 22:40:31 -0800
Message-ID: <1a68177.0202252240.49e8a3d4_at_posting.google.com>


Well i wouldnt bury the varchar to date conversion in the function. Well in the conversion of varchar to date you are not taking hours, minutes into consideration.
So if tomorrow if you want them also you have to change the function. Also why do you need to overload the function? You can just do the conversion in the program which is going to call this function.
Please tell me if i got it all wrong.
thanks
srivenu
hap_at_mikomi.org (Adam Hapworth) 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 Tue Feb 26 2002 - 07:40:31 CET

Original text of this message