 |
|
Putting Methods to Work in Oracle
Oracle Tips by Mike Ault |
Overloading of Methods
Method overloading could be used to provide a
common name for a method that would actually be several methods that
performed differently dependent upon the values passed as messages
to the method. An example of this type of method would be an update
method that updates a table attribute based on the value it is
passed. If it were passed a date value it would do the conversion to
character, same with a number. Or perhaps it would insert into a
"TYPE" attribute, a code based on input value.
The technique for overloading a method procedure
or function is identical to the overloading of standard procedure or
function.
create type
test3(type_passed varchar2(8),
member procedure input_type(in_char char),
member procedure input_type(in_varchar varchar2),
member procedure input_type(in_date date),
member procedure input_type(in_number number))
/
This method overloading allows incorporation of
polymorphism into object types.
SEE CODE DEPOT FOR FULL SCRIPTS
 |
If you
like Oracle tuning, you may enjoy the book
Oracle Tuning: The Definitive Reference , with
over 900 pages of BC's favorite tuning tips &
scripts.
You can buy it
directly from the publisher and save 30%, and get
instant access to the code depot of Oracle tuning
scripts. |
 |
Expert Remote DBA
BC is America's oldest and largest Remote DBA Oracle support
provider. Get real Remote DBA experts, call
BC Remote DBA today. |
 |
|