Extending Existing Data Types
You can define the following additional behavior for an existing built-in or complex data type:
Additional Operations
Universal Server defines operations on the data types that it provides. (For a list of these data types, see "Data Types That Universal Server Provides".) To extend operations in your database, you can write additional routines, called end-user routines, that end users can include in their SQL statements. You must register each end-user routine in the database with the CREATE FUNCTION (or CREATE PROCEDURE) statement. For more information, see "How Do You Extend an Operation?".
New Operator Classes
Universal Server provides a default operator class for the built-in secondary access method, a generic B-tree. This default operator class uses the relational operators (<, >, =, and so on) to order values in the generic B-tree. These relational operators are defined for the built-in data types only.
To provide additional sequences in which the B-tree orders values in the index, you might want to create an additional operator class for the generic B-tree. You define strategy and support functions that handle each built-in data type that you want to index with the new sequence. You must register this new operating class in the database with the CREATE OPCLASS statement. For more information, see "Extending an Existing Operator Class".
Additional Casts
Universal Server provides casts between the built-in data types that it provides. You might want to create additional casts to provide data conversion between an existing data type and an extended data type that you create. If the two data types have different internal formats, you must define a casting function to perform the data conversion. You must register the casting function with the CREATE FUNCTION statement and create the cast with the CREATE CAST statement before it can be used. For more information on casts, see Chapter 3, "Creating User-Defined Casts."
|