Define a UDT

UDTs are defined with a CREATE DISTINCT TYPE statement.

For the CREATE DISTINCT TYPE statement, note that:

  1. The name of the new UDT can be a qualified or an unqualified name.
  2. The source type of the UDT is the type used by the system to internally represent the UDT. For this reason, it must be a built-in data type. Previously defined UDTs cannot be used as source types of other UDTs.

As part of a UDT definition, the system always generates cast functions to:

These functions are important for the manipulation of UDTs in queries.

The function path is used to resolve any references to an unqualified type name or function, except if the type name or function is the main object of a CREATE, DROP, or COMMENT ON statement.

Related reference
Use qualified function reference
Related information
CREATE DISTINCT TYPE statement