Select to view content in your preferred language

When applying CopyFeature the OBJECTID Field changes.

817
2
Jump to solution
01-24-2024 06:53 AM
TrentSchweitzer
Occasional Contributor

I have a table that I am loading in from an enterprise oracle database, as a Feature Layer. Table view of feature layerTable view of feature layer

But after I apply the CopyFeature Tool to the table to create a local version  of the table, the UNIQ_ID field (type OBJECTID) is overwritten to new values.
Table view of copied feature layerTable view of copied feature layer
Is there some flag or step I am missing to prevent the values from being changed like this?
I have resorted to witting custom code to compare each row with the oracle table to find the value but this is painfully inefficient.

0 Kudos
1 Solution

Accepted Solutions
RyanUthoff
MVP Regular Contributor

I believe this is expected behavior. ObjectID columns are columns that are managed by Esri and we typically don't have much control over them. It's typically not recommended to use them for reasons like this.

With that being said, the Copy tool (not Copy Features) should maintain the ObjectIDs.

View solution in original post

2 Replies
RyanUthoff
MVP Regular Contributor

I believe this is expected behavior. ObjectID columns are columns that are managed by Esri and we typically don't have much control over them. It's typically not recommended to use them for reasons like this.

With that being said, the Copy tool (not Copy Features) should maintain the ObjectIDs.

TrentSchweitzer
Occasional Contributor

Thank you for the suggestion of using the Copy tool. Doing this at least made a stand alone copy of the Feature Class. I was then able to use the Make XY Event Layer tool to make the stand alone table a feature layer. This preserved the ObjectID values.

0 Kudos