Hi there,
I have a backend component that is sending a few requests to our ArcGIS server (Note: both Ids 2 and 8 are pointing to Views in the DB). The first request below is successful and data is retrieved
URL: {baseUrl}/rest/services/{environment}/ContactView/FeatureServer/2/query?where=1%3D1&f=pjson&resultOffset=0&resultRecordCount=500&outFields=*&returnGeometry=false
Response:
{
"objectIdFieldName": "ObjectId",
"globalIdFieldName": "",
"fields": [
{
"name": "Name",
"alias": "Name",
"type": "esriFieldTypeString",
"length": 255
}
],
"features": [
// Data
],
"exceededTransferLimit": true
}
However, the second request fails
URL: {baseUrl}/rest/services/{environment}/ContactView/FeatureServer/8/query?where=1%3D1&f=pjson&resultOffset=0&resultRecordCount=500&outFields=*&returnGeometry=false
Response:
{
"error": {
"code": 400,
"message": "Unable to complete operation.",
"details": [
"Unable to perform query operation.",
"Invalid query"
]
}
}
The interesting thing from the second request is that if I remove the values from resultOffset and resultRecordCount, e.g.
resultOffset=&resultRecordCount=
The request is successful and comes back with data.
Not sure what would be the issue - hope someone can shed some light on this
UPDATE: a bit more information about this, the DB View in question doesn't seem to have any problem, if I query the View directly in the DB, the View will return data. It is only when I use resultOffset and resultRecordCount in my REST request that makes this fails.
Does anyone know how ArcGIS tranlsate the REST query into a SQL statement? Would it be something like the sql below?:
select * from MyView
ORDER BY (Select null)
OFFSET 0 ROWS FETCH NEXT 500 ROWS ONLY
If I run that sql above directly in the DB, I get data back from the View
Thanks in advance,
Luis