I need use the ArcGIS REST API to query my ArcGIS Server services, the where parameter is like ObjectID in (1, 2, 3,...,2000). When the number of object ids is larger than 1000, the returned result shows "Unable to complete operation".
Depending on the type of database, there may be a limit on the amount of items that can be inside the
IN clause. I think Oracle has a limit of 1000.
Two things you could try are:
- Instead of using
objectids=1,2,3, ...in the REST call
- Split the list of objectids in groups of 1000:
where=objectid in (1,2, ... ,1000) OR objectid in (1001,1002, ... ,2000)
The above solution will fix the error message, but you'll still hit the 1000 feature limit imposed by ArcGIS Server. 1000 features is the default in current versions, in older version it used to be 500. To get more than 1000 features, you need to change a setting in ArcGIS Server, or do multiple requests in batches of 1000.
You should also ask yourself if you really need to get all features. There are valid use-cases to do so, but it would help if you tell us why you think you need to.