Select to view content in your preferred language

syntax for query using variable name

874
2
Jump to solution
06-22-2017 08:46 AM
GünterDörffel
Frequent Contributor

Hi,
I searched for the proper syntax to do a query like this ...
xxLayer.query(where = 'objectid > 0')
but instead of giving it the value (here 0) this should be a variable
How is that done?

Thanks Günter

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Can you try 

query_result = FeatureLayer.query(where = 'objectId > ' + str(layer_id))

View solution in original post

2 Replies
by Anonymous User
Not applicable

Can you try 

query_result = FeatureLayer.query(where = 'objectId > ' + str(layer_id))
GünterDörffel
Frequent Contributor

Smooth and straight. I googled, searched ... found stuff like %s, var ... but did not test the "Esri way" 🙂  Thanks!