Distinct data type

A distinct data type has an internal and external representation identical to another data type, but the database server treats it as a different data type. Any existing routines on the source data type are automatically registered on the distinct data type. However, you can define new routines that operate only on the distinct data type.

You can define custom support routines and user-defined routines for your distinct data type. You can also overload existing user-defined routines and built-in routines to work on your distinct type.

The following table lists the properties you specify when you create a distinct data type.
Property Default value Description
Name prefixDistinctType The name of the distinct type. This name must be unique.
Source type None The data type the distinct type is based on. Can be any existing data type. The distinct type inherits all properties of the source type.
When you create a distinct data type, the database server creates explicit casts between the source data type and the distinct data type; however, you can also create implicit casts between a distinct data type and its source data type.
Tip: If you create a distinct type with a source type of BLOB, CLOB, or an opaque data type containing BLOB or CLOB arguments, you can test for the existence of a particular sbspace when your DataBlade® module is being registered in a database by using BladeManager.