2094956- ASE ODBC: SQLDescribeParam throws errors such as The untyped variable ? is allowed only in in a WHERE clause or the SET clause of an UPDATE statement or the VALUES list of an INSERT statement or The data type or the function is not supported

Symptom

Some queries (INSERT in this case) are sent to ASE as dynamic SQL and return an error:

[SAP][ASE ODBC Driver][Adaptive Server Enterprise]The untyped variable ? is allowed only in in a WHERE clause or the SET clause of an UPDATE statement or the VALUES list of an INSERT statement(7332)

[SAP][ASE ODBC Driver]The data type or the function is not supported. (30094)

The insert command is in the form of INSERT into TABLE (Column List) SELECT convert(type, ?), ....

The ODBC application calls SQLDescribeParam, and forces ASE ODBC to issue dynamic SQL to obtain the metadata on the parameters and ASE doesn't support this syntax for dynamic SQL and throws the errors.