QueryParameters with AND condition

966
3
06-16-2021 04:53 AM
AleksandrGorshkov
New Contributor II

Hi! I tried to use query parameters for getting a feature list by query. In case if I use AND parameter is SQL, I get an inconsistent result. 

Is AND condition works?

val visibleParams = QueryParameters()
visibleParams.whereClause = shortname IN ('short_test') AND subdivision IN ('division1', 'division2')
0 Kudos
3 Replies
RamaChintapalli
Esri Contributor

The AND operator should work and return consistent results. I tried modifying the below sample to use AND condition in query clause and it returned consistent result.

https://github.com/Esri/arcgis-runtime-samples-android/blob/main/java/feature-layer-query/src/main/j...

Changed above where condition as below,

query.setWhereClause("upper(STATE_NAME) LIKE '%" + searchString.toUpperCase() + "%' AND TOTPOP_CY > 1000000");


Could you repro the issue you are encountering using the service from above sample?

Thanks
Rama

0 Kudos
AleksandrGorshkov
New Contributor II

@RamaChintapalli hello! 

I found that NOT IN operator give me inconsistent result:

crop_shortname NOT IN ('short_name1') AND subdivision NOT IN ('sub1')

Are NOT IN should work properly? 

0 Kudos
RamaChintapalli
Esri Contributor

Hi @AleksandrGorshkov 

All SQL operations supported by service/local SQLite geodatabase are expected to work. I just tried NOT IN operator on another FeatureService which worked consistently.

You can also contact our support team and they will be able to debug through your data and see where the problem exactly is.

Thanks

Rama

0 Kudos