Apologies for posting this both here and GIS.stackExchange (ArcGIS server 10.1 rest api queries fail inconsistently - Geographic Information Systems Stack Excha...
I have a set of Map and Esri Feature Services running on a 10.1 ArcGIS Server, with SQL Server in the back end.
When I query the layers for either the geometry or OIDs using the rest interface, the query only works in certain instances.
I get the error message
{"error":{"code":400,"message":"Unable
to complete operation.","details":["Unable to perform query
operation."]}}
The server log files show: Database error:
Operation without query criteria is not allowed.
However this query (same service, different polygon layer) works as expected and returns the feature geometry:
There are 2 polygon layers that I can query and get the expected result but all other polygon layers fail and for the life of me I cannot see any difference in the properties of the feature classes that fail vs those that do not.
If I dirty the query (by adding a where clause 1=1) I get the expected result; so for example, this query works:
What I’ve looked at:
I’d be grateful for any pointers or areas that I should look at.
Thanks in advance!
Message was edited by: Asrujit SenGupta
Strange, all 3 URL's posted return a valid result for me...
Now that's interesting thanks Xander! I'll work on our outside tester this morning.
Actually my mistake, the first link (that doesn't work) should be
That URL indeed does not work (although I'm using a different network than yesterday).
I though this might be due to specifying the geometryType parameter without specifying a geometry, but when I remove it, it still does not work. When adding the 1=1 as whereclause it does work... (as you said).
I see that you are using ArcGIS for Server 10.1 SP1. If I use the query on a service here using the exact same parameters it throws me this error:
{"error":{"code":400,"message":"Invalid or missing input parameters.","details":[]}}
Different from yours, but still an error. I think you can best include the where clause 1=1 or using a random number (random number = random number) to avoid it.
In case you don't want to specify a where clause you can still use the geometry with an envelope that covers the area:
Thanks for looking at this Xander. Interesting workaround with the envelope; that's good to know. thanks again,
my error
{"error":{"code":400,"message":"Invalid or missing input parameters.","details":[]}}
however 1=1 worked for me. thx
not sure if related to the error i was getting but found one of the geometry features had no coords
{
"attributes": {
"Name": "sample"
},
"geometry": {
"rings": [
]
}