Too Nice
Bill C, December 20, 2010 - 2:18 pm UTC
You are way too nice. It must be Christmas.
I hope he enjoys the gift.
Thanks
Simeon Brett, December 20, 2010 - 3:41 pm UTC
Thank you, Tom. This really helped. In retrospect, the answer should have been obvious, but it wasn't.
Sorry about the lack of examples. This is my first question to you and I thought by giving the signatures, it was all you were looking for,
Thank You!
Mary Couette, February 17, 2011 - 12:42 pm UTC
I had a similar issue. I was passing a string forced to a number because of a computation on the value from a sub-query to an overloaded function expecting a varchar. It works if I force it to a char or a number, but if I leave it at whatever ambiguous type the sub-query leaves it, it fails.
Overloading useful?
A reader, June 12, 2012 - 1:47 am UTC
Hi Tom,
I find overloading of procedures etc to be a pain the ...
trying to maintain someone elses code is annoying with overloading.
What is the benefit to overloading?
and have you done any tests on if it is efficient?
Lets say we a procedure that is overloaded depending
on if a string, a date or a number is passed
It seems to me the optimzier needs to go searching for the matching function or stored prcedure
Would'nt it be easier to have my_sp_string, my_sp_date, my_sp number? that way exec my_sp_string or exec my_sp_date just gets executed rather than lets look at the parameters and go looking for which overloaded version of my_sp() matches
Regards
Doug
June 12, 2012 - 4:38 am UTC
What is the benefit to overloading?
ease of use.
Look at the DBMS_SQL package - overloaded for dates, numbers, strings, clobs, etc. Rather than have "dbms_sql.bind_a_number, dbms_sql.bind_a_string, ...." you just have "dbms_sql.bind_variable" - one routine that does the same thing regardless of type.
And that is no harder to maintain then having a bind_a_number, bind_a_string, etc.
The looking bit your are talking about happens at compile time, there isn't a run time overhead involved.
Some people swear by overloading.
Some people swear at overloading.
fully 1/3 of the Oracle supplied packages make use of it. I've made use of it. I view it as a positive thing in general. If you code in a modular fashion, there shouldn't be any maintenance issues with it.
Fair enough
A reader, June 12, 2012 - 5:12 am UTC
Point taken about dbms_sql
>If you code in a modular fashion, there shouldn't be any >maintenance issues with it.
This statement highlights its probably more how I see people using overloading more than overloading itself
Thankyou