6864 The %VSTR routine must be UDF.
A routine is expected to be User Defined Function. -- The TO SQL routine specified in a CREATE TRANSFORM statement must be a UDF. -- The CAST routine specified in a CREATE/REPLACE CAST statement must be a UDF if the Source data type for the CAST is pre-defined type and the Target data type is Distinct or Structured UDT type.
Correct and re-submit the query.