|Oracle 8i Data Cartridge Developer's Guide
Release 2 (8.1.6)
Part Number A76937-01
Defining Object Types , 5 of 5
SQL performs comparison operations on objects. Comparisons can be explicit, using the comparison operators (=, <, >, <>, <=, >=, !=) and the
IN predicates. Comparisons can be implicit, as in the
Comparison of objects makes use of special member functions of the object type: map methods and order methods. To perform object comparison, you must implement either a map method or order method in the
For example, the type body for the DataStream type, implements the map member function for DataStream comparison as:
This definition of the map member function relies on the presence of the id attribute of the DataStream type to map instances to integers. Whenever a comparison operation is required between objects of type DataStream, the map function DataStreamToInt () is called implicitly by the system.
The object type rational_type does not have a simple id attribute like that for DataStream. For rational_type, the map member function is slightly more complicated. Because a map function can return any of the built-in types; rational_type can return a value or type
If you have not defined a map or order function for an object type, only equality comparisons are allowed on objects of that type. Oracle SQL performs the comparison by doing a field-by-field comparison of the attributes of that type.