Skip Navigation
Expand
This query is not supported:  Cannot use column within WHERE clause:
Answer ID 11823   |   Last Review Date 01/18/2023

Why am I receiving a receiving a "This query is not supported:  Cannot use column within WHERE clause: '<field name>'" when using certain fields in my ROQL query? 

Environment:

ROQL, Connect Web Services for SOAP (CWS) API, REST API, Connect for PHP API, All product versions 

Resolution:

If the field is defined as a BLOB field (any field that can contain more than 256 characters), it cannot be used in the WHERE clause in a ROQL query.  One way to determine the size of a field is to look in the Data Dictionary at the Column Information by clicking on the specific field.  Once the Column Information displays, you can see the Data Type of the field.  If the Data Type indicates either Medium Text or Long Text or Blob, these fields can contain more than 256 characters so cannot be used in the WHERE clause.  

Custom fields are not available in the data dictionary.  You can view the field type in the  Custom Fields component under Configuration button > Database folder > Custom Fields. 

Please refer to the ROQL query WHERE clause in our online Documentation.