Figure 1-3 User-Defined Data Types of Universal Server Data Type Explanation Distinct data type Is stored in the same way as the source data type on which it is based, but has different casts and functions defined over it than those on the source type. Opaque data type Fundamental data type that the user defines. (A fundamental data type is atomic; that is, it cannot be broken into smaller pieces, and it can serve as the building block for other data types). This section summarizes the kinds of data types that you can define to extend the Universal Server data type system. For more information, see the chapter on data types in the Informix Guide to SQL: Reference.
Distinct data type
Is stored in the same way as the source data type on which it is based, but has different casts and functions defined over it than those on the source type.
Opaque data type
Fundamental data type that the user defines. (A fundamental data type is atomic; that is, it cannot be broken into smaller pieces, and it can serve as the building block for other data types).
The Opaque Data Type The opaque data type is a fundamental data type. However, unlike the other fundamental data types (the built-in data types), the internal structure of the opaque data type is not known to the database server. Therefore, when you define an opaque type, you must provide the following information:
A Distinct Data Type A distinct type has the same internal structure as some existing data type. However, it has a distinct name and therefore distinct functions that make it different from its source type. When you define a distinct type, you provide the following information:
A Named Row Type A named row type has a group of one or more components called fields. Each field has a name and a data type. The fields of a row type can be any data type except SERIAL and SERIAL8. Some exceptions exist for the fields of a row type that are the TEXT or BYTE data type. Named row types are identified by their names. When you define a named row type, you provide the following information:
DataBlade Module Data Types In addition to the data types that you explicitly define, you can obtain new data types from an Informix DataBlade module. A DataBlade module might provide the data type, including any casts, operations, and secondary access methods, for an application-specific purpose. For more information on the DataBlade modules available, consult your Informix sales representative or refer to the user guides for the DataBlade modules. Ways to Extend With New Data Types You can extend the following data type information for an existing built-in or complex data type:
Extending Operator Classes The default operator class that Universal Server provides for the built-in secondary access method (a generic B-tree) handles only built-in data types and uses the relational operators (<, >, =, and so on) to order values. You might want to extend an operator class to support an extended data type for the following reasons:
Creating 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: