C/C++ functions that provide cast, ordering, or transform functionality for a UDT must satisfy certain requirements.
| UDT Type | What Function Provides | What Function Must Do |
|---|---|---|
| Structured | Cast functionality from another UDT or predefined type to UDT | Set attribute values of UDT result using value of input argument. |
| Cast functionality from UDT to another UDT or predefined type | Set value of result using attribute values of UDT input argument. | |
| Transform functionality for importing UDT to server | Transform value of predefined type input argument into attribute values of UDT result. | |
| Transform functionality for exporting UDT from server | Transform attribute values of UDT into appropriate values for predefined type result. | |
| Ordering functionality for comparing two UDTs | Use attribute values of UDT to set result to value that Vantage uses for comparisons. | |
| Distinct | Cast functionality from another UDT or predefined type to UDT | Set value of UDT result using value of input argument. |
| Cast functionality from UDT to another UDT or predefined type | Set value of result using value of UDT input argument. | |
| Transform functionality for exporting UDT from server | Transform value of predefined type input argument in value of UDT result. | |
| Transform functionality for exporting UDT from server | Transform value of UDT into appropriate value for predefined type result. | |
| Ordering functionality for comparing two UDTs | Use value of UDT to set result to value that Vantage uses for comparisons. |
Vantage automatically generates cast functionality between a distinct type and its predefined source type. You can create additional functions for casting between a distinct type and other predefined data types or UDTs.
Although Vantage automatically generates transform and ordering functionality when you create a distinct type, you can drop the functionality and provide your own. Note that Vantage does not automatically generate ordering functionality for distinct UDTs where the source data type is a LOB.