This is expected behavior resulting from a driver limitation. Per release note# OE00196260:
[DataDirect][ODBC SQL Server Driver] behavior to 'MAX' datatype in WHERE clause MSS DataServer provides capability of mapping MS SQL Server Large value data types, for instance VARBINARY (MAX), VARCHAR (MAX) and NVARCHAR (MAX), to OpenEdge CHARACTER data types with a data limit of 30K in size.
Hence mapped as above, MSS DataServer also supports using OpenEdge CHARACTER datatype in a WHERE clause.
However, with the DataDirect Driver, it is not possible to use a parameter of the type VARCHAR(MAX) in a WHERE clause when using an equal operator. The following ODBC error will occur "DataDirect][ODBC SQL Server Driver][SQL Server]The data types varchar(max) and text are incompatible in the equal to operator."
For more information, please refer to the following knowledge base link from DataDirect:
The data types varchar(max) and text are incompatible in the equal to operator"
Functionality-wise, when processing the query, the DataServer calls ODBC functions to prepare the query (SQLPrepare), bind the parameter data to the query (SQLBindParameter) and then execute it (SQLExecute). The problem occurs when the bound parameter has type SQL_LONGVARCHAR; SQLBindParameter succeeds but SQLExecute fails.
When using a third party tool or RUN STORED PROCEDURE send-sql-statement, the complete query is passed so there is no need to bind parameters; ODBC function SQLExecuteDirect is called instead.