If data_type is a character type, then this is the server character set used by data_type , otherwise you cannot specify anything.
The purpose of the CHARACTER SET clause is to influence the system-generated routines.
The CHARACTER SET clause causes the following things to occur when the system creates the distinct type named UDF_name:
- The system-generated CAST routines are registered to cast to and cast from a character source type of the specified server character set.
- The system-generated ORDERING routine is registered to map to a character source type of the specified server character set.
- The system-generated tosql and fromsql TRANSFORM routines are registered to transform the UDT to and from a character source type of the specified server character set.
If you know that all database transactions occur in languages that can be expressed using the LATIN character set, specify LATIN. Otherwise, for example, if some or all transactions use non-LATIN or multibyte characters, specify UNICODE. See International Character Set Support.