Home | Previous Page | Next Page   Data Types > Description of Data Types >

Distinct (IDS)

A distinct type is a data type that is derived from one of the following source types (called the base type):

A distinct type inherits from its source type the length and alignment on the disk. A distinct type thus makes efficient use of the preexisting functionality of the database server.

When you create a distinct data type, the database server automatically creates two explicit casts: one cast from the distinct type to its source type and one cast from the source type to the distinct type. A distinct type based on a built-in source type does not inherit the built-in casts that are provided for the built-in type. A distinct type does inherit, however, any user-defined casts that have been defined on the source type.

A distinct type cannot be compared directly to its source type. To compare the two types, you must first explicitly cast one type to the other.

You must define a distinct type in the database. Definitions of distinct types are stored in the sysxtdtypes system catalog table. The following SQL statements maintain the definitions of distinct types in the database:

For more information about the SQL statements mentioned above, see the IBM Informix: Guide to SQL Syntax. For information about casting distinct data types, see Casts for Distinct Types. For examples that show how to create and register cast functions for a distinct type, see the IBM Informix: Database Design and Implementation Guide.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]