TREAT AS can only be used with extended types. Cannot treat %1 as a %2

Error constant SQLE_TREAT_AS_ONLY_EXTENDED
ODBC 2 state ERROR
ODBC 3 state ERROR
Parameter 1 The value that could not be converted.
Parameter 2 The name of the type for the conversion.
Severity 16
SQLCODE -1361
SQLSTATE 53020
Sybase error code 13201
 Probable cause