DataQueryBuilder seems not to be working

I have a table with a column named state.

When I try to use the following code on searching via the rest api, I get an error:

DataQueryBuilder dataQuery = DataQueryBuilder.create();
dataQuery.setWhereClause(String.format(“state = %s”, state));;
List dataIWant = Backendless.Data.of(E.class).find(dataQuery);

400 - Column ‘PA’ does not exist in table ‘TABLE_NAME’ (1054)

What am I doing wrong?


I suspect the data type of the state column is String. As a result, the value in your whereaclause must be surrounded by single quotes:

state = 'PA'

Hope this helps.