Relational operators operate on expressions of numeric and string values. The following table lists the operator functions that the database server provides.
All relational operator functions must return a Boolean value. For more information on relational operators, see the Relational Operator segment in the IBM Informix: Guide to SQL Syntax.
For end users to be able to use values of a new data type with relational operators, you must write new relational-operator functions that can handle the new data type. In these functions, you can:
For example, you might create the circle opaque data type to implement a circle. A circle is a spatial object that does not have a single value to compare. However, you can define relational operators on this data type that can use the value of its area: one circle is less than a second circle if its area is less than the area of the second.
For example, suppose you create a data type, ScottishName, that holds Scottish names, and you want to order the data type in a different way than the U.S. English collating sequence. You might want the names McDonald and MacDonald to appear together on a phone list. You can define relational operators for this data type that equate the strings Mc and Mac. For more information, see Changing the Sort Order.
After you define the relational operators, you can use SQL statements such as the following one:
SELECT * FROM employee WHERE emp_name = 'McDonald'::ScottishName
The relational-operator functions are strategy functions for the built-in secondary-access method, a generic B-tree. For information on strategy functions, see Operator Classes.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]