Creating a cast that has a cast function
About this task
You can create special SQL-invoked functions, called cast functions, that implement data conversion between two dissimilar data types. When two data types have different storage structures, you must create a cast function that defines how to convert the data in the source data type to data of the target data type.
To create a cast that has a cast function: