syntax for query using variable name

693
2
Jump to solution
06-22-2017 08:46 AM
GünterDörffel
Occasional Contributor III

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
Occasional Contributor III

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