Salesforce

The data types varchar(max) and text are incompatible in the equal to operator

« Go Back

Information

 
TitleThe data types varchar(max) and text are incompatible in the equal to operator
URL Name3291
Article Number000122711
Environment
Question/Problem Description
An error occurs when using a varchar(max) field in the WHERE clause of a SQL statement.
Steps to Reproduce
Clarifying Information
Error Message[DataDirect][ODBC SQL Server Driver][SQL Server]The data types varchar(max) and text are incompatible in the equal to operator
Defect Number
Enhancement Number
Cause
Resolution
This is expected behaviour.
It is not possible to use a parameter of the type varchar(max) in a WHERE clause when using an equal operator.

Use SQLGetTypeInfo Function to find out what datatypes are searchable. The SEARCHABLE Column name returns SQL_PRED_CHAR for the varchar(max) data type : SQL_PRED_CHAR is returned if the column can be used in a WHERE clause, but only with the LIKE predicate. (This is the same as the SQL_LIKE_ONLY value in ODBC 2.x.)
Workaround
Notes
Keyword Phrase
Last Modified Date9/14/2015 6:26 AM

Powered by