The tosql routine maps a predefined data type value to a UDT value. The system invokes it automatically whenever a UDT value is transferred to Teradata Database from a client application.
Note that the external routine invoked by a tosql clause must be an external UDF. It cannot be a method.