I published a feature service from a view table in PostgreSQL to a standalone ArcGIS Server. I was able to view the feature layer in ArcGIS Online and was able query using the where clause.
However, when I open the attribute table, I get strange behaviours.
The feature count is wrong. The source layer has 914 features, but the attribute table shows 2,000.
When I select a row and click Center on Selection, nothing happened.
So, I checked the log file in ArcGIS Server Manager and saw this "Error: The table does not have an OID Field".
When I try to query at the REST endpoint using the Object ID, or return ID only or return count only, I get a "Unable to complete operation" error. The same "Error: The table does not have an OID Field" error appeared in the log file.
I have confirmed the feature layer has an ObjectID.
What did I miss?
Hi, Jon Kwong. Did you solve this problem?
I am having the same issue here with ArcGIS Server 10.7.1. My database is Oracle 11g and the field been used as ID in the view has been cast from number(12) to number(10), which ArcMap recognizes as Long Integer.
I didn't really solve it. I realise that I do not need editing in my workflow. I just need a read-only feature layer. So, instead of the publishing the query layer as a feature service, I just publish it as a map service and use the feature layer.
Hi Thiago dos Santos Nascimento
... the field been used as ID in the view has been cast from number(12) to number(10), which ArcMap recognizes as Long Integer.
On the above issue where your ID field gets recognized has a long integer instead of an objectid field, please read the following help - this might help.
here is an excerpt from Choose a unique identifier field—Query layers | ArcGIS Desktop
To be used as a unique identifier in ArcGIS, a field must be not null, contain unique values, and be one of the following data types:
This is a ArcGIS Pro help, but the same concept applied in ArcMap too.
Hi, Tanu Hoque
Thanks for the suggestions.
In every attempt bellow, I made it sure that the field in question was not null and contained only unique values:
Finally, I did not made any attempts with the other field types (GUID and Date) as the table I have to work with does not use them.
Notes: