Query with were fails

383
1
05-20-2019 05:17 AM
LarsFagerbakke
New Contributor III

My query:

../Mapserver/5/query?f=pjson&where="PROJECTNUMBER"="ABC123"


Returns:

{
"error": {
"code": -2147216086,
"message": "Failed to execute query.",
"details": []
}
}

The server is running version 10.31. My query was built by example from the docs (https://developers.arcgis.com/rest/services-reference/query-map-service-layer-.htm) and I've tried PROJECTNUMBER with and without the quotes.

Am I missing something?

Tags (1)
0 Kudos
1 Reply
Egge-JanPollé1
MVP Regular Contributor

Hi Lars Fagerbakke‌,

I think your query should be

../Mapserver/5/query?f=pjson&where=PROJECTNUMBER='ABC123'

i.e. Field name unquoted and value single quoted

I tested this with this URL:

https://mapservices.prorail.nl/arcgis/rest/services/Gebiedsindelingen_ProRail_005/MapServer/14/query...

Does this solve your issue?

BR,

Egge-Jan