Applications often need to use user-defined types. Client-Library makes it easy for applications to both create and convert user-defined datatypes:
In Client-Library applications, user-defined types are C-language types. To create them, an application simply declares them. (Don’t confuse Client-Library user-defined types with Adaptive Server user-defined types, which are database column datatypes created with the system stored procedure sp_addtype.)
To convert user-defined types to and from other user-defined types and standard Client-Library types, you can write custom conversion routines and add code to install them in Client-Library. Once the conversion routines are installed, Client-Library calls your custom routines to transparently handle all conversions.
CS-Library routines related to user-defined types include:
cs_set_convert – installs a custom conversion routine to convert between standard Open Client and user-defined datatypes.
cs_will_convert – indicates whether conversion of a datatype is supported.
cs_setnull – defines a null substitution value for a user-defined datatype.