Relational operators for opaque data types
The database server provides operator functions for the relational operators listed in Relational operators. The relational-operator functions that the database server provides handle the built-in data types. You can overload a relational-operator function to provide the associated operation on your new opaque data type.
If you overload a relational-operator function, make sure you follow
these rules:
- The name of the relational-operator function must match a name listed in Relational operators. However, the name is not case sensitive; the equal() function is the same as the Equal() function.
- The relational-operator function must take two parameters, both of the opaque data type.
- The relational-operator function must be a Boolean function; that is, it must return a BOOLEAN value.
You must define an equal() function to handle
your opaque data type if you want to allow columns of this data type
to be:
- Constrained as UNIQUE or PRIMARY KEY
For more information about constraints, see the CREATE TABLE statement in the HCL OneDB™ Guide to SQL: Syntax.
- Compared with the equal (=) operator in an expression
- Used with the IN operator in a condition