|
|
| |
 |
|
Putting Methods to
Work in Oracle
Oracle Tips by Mike Ault |
Method Basics
In Oracle8, methods can also be used in
comparative operations when used with user-defined object types. In
the traditional relational model, scalar values of type VARCHAR2
and NUMBER were easy to compare and contrast. This simplicity
diminishes when the data types are more complex. Map and
Order methods comprise the set of comparison type methods.
Map methods provide a way to compare two objects to
determine a quantitative outcome. For example, let's say you defined
an object type of VEHICLE, you might specify an attribute
that describes the maximum speed. Map methods could perform a
comparison to determine the vehicle with the fastest or slowest
maximum speed. Order methods offer a different
perspective. Order methods use internal logic to compare two
objects. Order methods are well-suited for making comparisons of
small groups of instances against a single value. An order method
returned value is not quantitative but, rather, qualitative. In
other words, a return value would simply state that object A is less
than object B (return value of -1), objects A and B are the
same/equal (return value of 0), or object A is greater than object B
(return value of 1).
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. |
 |
|
|
|
|