Feature Service - Table does not have an OID Field error

12-25-2019 05:38 PM
New Contributor III

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.

feature count 

So, I checked the log file in ArcGIS Server Manager and saw this "Error: The table does not have an OID Field".

Log file

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.

Query objectid

I have confirmed the feature layer has an ObjectID.


What did I miss? 

4 Replies
New Contributor II

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.

0 Kudos
New Contributor III

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.

Esri Regular Contributor

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.

New Contributor II

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:

  • I only had success when the field used as objectid was a column of type NUMBER(10).

  • A column of type NUMBER(12), is not accepted as valid field for objectid. I had to try this because the legacy table I will work with uses this type originally.

  • With a column of type VARCHAR2, the published Feature Service is not usable:in ArcMap, the service does not draw any features at all and the layer's attribute table appears empty as well.
    • at the Server Log it says: "Error: Attribute column not found[ORA-00904: "ESRI_OID": invalid identifier].".
    • Notice that this field is added automatically by ArcGIS and the error persists even when I disable it before publishing.

  • I also tried with columns of the types NUMBER(38) and INTEGER. At first, they are accepted as valid columns, but the service displays strange behaviors:
    • in ArcMap, when selecting features, they are highlighted only at the attribute table, not in the map. Additionally, when I switch the option to show only the selected records in the attribute table, it shows none.
    • at the Server Log it says: "Error: The table does not have an OID Field."

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.


  • All columns of NUMBER and INTEGER are recognized as Long Integer by ArcMap.
  • I am using Oracle, ArcGIS Server 10.7.1 and ArcGIS Desktop 10.8.
0 Kudos