Backendless Support
 
Answered

Follow us Question: setWhereClause

Hi,

I have a follow up question of [this question]. Can I set multiple where clauses?

Regards

Rhonwen

Leave a Comment

Comments (5)

photo
1

I see I can put an extended string.

When I put in the following:

  1. builder.setWhereClause("email != '" + Backendless.UserService.CurrentUser().getEmail() + "'" + "AND staffType = 'Default

...It does not work.

photo
1

I tried to repeat the where clause.

See code below:

  1. builder.setWhereClause("email != '" + Backendless.UserService.CurrentUser().getEmail() + "'");
  2. builder.setWhereClause("accepted = '" + query + "'");

...does not work. gets overridden by last where clause

photo
1

You can assign only one where clause. Your whereClause may contain AND/OR logical operators to have multiple conditions, but there must be only one whereClause query statement.

Regards,

Mark

photo
1

I did that and it did not work, But I sorted it out with an if statement. No need for multiple conditions in the where clause anymore.

Thank you for the Help. Maybe I did something wrong. It is quite possible since I worked through the night on my app.

Kind Regards

Rhonwen

photo
1

I missed a single quotation after 'DEFAULT ' and a space before the 'AND' operator.