BackendlessException{ code: '1017', message: 'Invalid where clause' }

String whereClause = “email =” + params[0]; // params[0] is the email i search for

BackendlessDataQuery dataQuery = new BackendlessDataQuery();

dataQuery.setWhereClause(whereClause);

BackendlessCollection<Student_data> result = Backendless.Persistence.of(Student_data.class).find(dataQuery);

finally i recive this error
BackendlessException{ code: ‘1017’, message: ‘Invalid where clause’ }

Hello!
Parameter should be surrounded by quotes:

String whereClause = "email = '" + params[0] + "'";

Alex

Thank you
but i recive this error
BackendlessException{ code: ‘1017’, message: ‘Invalid where clause. Not Existing columns: email’ }
although i inserted column email to this object
how can i see object columns on the backendless

This message informs you that your table “Student_data” doesn’t have property “email”.

You can see all table columns at your data console.
Also, provide your applicationId here.

i understand what you say
now i inserted an object class
the backendless make table with id for this object how can i search for column value in all objects ?!

Your where clause looks suitable for this purpose, and this error really looks unexpected.

Send your application id please so we can find the problem and help.

6EDD4F2D-E780-9B9C-FF5D-21F589050F00 This is the app id

Thank you!

Your Student_data table doesn’t have column “email”, so the exception is valid.
Clarify please what exactly you want to do. For example “I want to retrieve all User objects where emails starts with “abc”…”

iam new to backendless

i inserted email student_data class to insert the current user email to this student
so when this user log in retreve all student object that have this user email :slight_smile:

Clarify please what do you mean under “i inserted email student_data class”. Did you add property “email” to “Student_data” class? Or something else?

yes property “email”

more calrify
now i need when the user login to see all students that he already inserted
so i add property “email” to student _data class to set email of the current user
so when the user loged in i will get the current user email and compare this email with the property "email " of the object so if similar will add this object to Arraylist to display them in the activity

Ok, I’ve got your idea. Writing all your code is out of free support, so I can offer you to do the following:

  1. Add property “email” manually from your console
  2. Before making any requests to server call
Backendless.Data.mapTableToClass( "Student_data", Student_data.class );
  1. Make sure that your Student_data class contains public default no-argument constructor and getters/setters for all properties

I thing that the best way for you is to use our code generation feature and look through examples available on github.
Also see the documentation for persistence: https://backendless.com/documentation/data/android/data_overview.htm and webinars: https://backendless.com/category/data-service/

Hope it helps,
Alex Navara

is there a question here?