The following example reports both the source and target castings for the UDT named address:
HELP CAST address;
Result:
Source Target Cast Routine As Assignment ---------------------------------------------------------------------- address VARCHAR(80) address_2_char YES VARCHAR(80) address char_2_address YES
Note the following things about this report:
- The castings from address to VARCHAR(80) and from VARCHAR(80) to address are complementary to one another.
- Both casting routines are user-defined, which you can tell because neither is named System.
- This UDT has only one casting pair defined for it, neither of which is named System, which suggests that it is probably a structured type.
Castings for structured types are never system-generated, while the system always generates default casts for distinct types. Because it is also possible to drop the system-generated casts for a distinct UDT and replace them with user-defined casts, the inference that the casting reported in this example is for a structured UDT cannot be made with certainty. See CREATE CAST and REPLACE CAST for details.