Tasks You Must Perform To Create A Distinct UDT
Because distinct types are created with inherent transform, ordering, and casting capabilities (see “System‑Generated Default Functionalities For Distinct UDTs” on page 751), you need not take any action to create or activate any of these capabilities. These various functionalities are generated silently and activated at the time you submit the CREATE TYPE request.
This means that to create a minimal, fully functional distinct UDT, you need submit only a CREATE TYPE request. The following associated functionalities are then generated for you automatically by the system:
If your applications of the current distinct UDT require additional functionality, you can write instance methods in either the C or C++ languages, and then submit CREATE INSTANCE METHOD statements to declare any SQL-invoked methods to be associated with their distinct UDT.
Additionally, if you do not want to use the system‑generated semantics for a distinct UDT, you can define your own unique ordering, transform, and casting functionalities.
To do this, you must perform the following high‑level general procedure.
1 Drop the system‑generated casts, orderings, or transforms you want to replace using the appropriate SQL DROP statements from the following list:
2 Code the appropriate external routines in either C or C++ (see SQL External Routine Programming)
3 Create new casts, ordering, or transforms for the UDT using the appropriate SQL CREATE statements from the following list: