Select to view content in your preferred language

appending to feature class and related tables

374
2
01-17-2024 11:11 AM
Labels (3)
clt_cabq
Occasional Contributor III

I have some legacy data in a flat file that I want to import to a geodatabase where I have a 1:m feature class with related tables. Some records in the flat file will be appended to the feature class while other fields form records in a related table. What is the best way to accomplish this since new records imported into the FC will populate with a new GUID that will need to find its way into the related table's "parent GUID" when related records are added? 

0 Kudos
2 Replies
MarceloMarques
Esri Regular Contributor

add new fields to the featureclass to hold the original primary key and original foreign key records. e.g. orig_pk , orig_fk.

perform the data load, then you can use a SQL Update statement to update the geodatabase relationship foreign key that can be based on the ObjectID or the GUI column.

SQL access to enterprise geodatabase data—ArcMap | Documentation (arcgis.com)

if you do not know SQL then you can use a Python Arcpy script or Model Builder or any other method in ArcGIS Pro to match the records using the original primary key and original foreign key and then update the foreign key using the ObjectID or GUI.

| Marcelo Marques | Principal Product Engineer | Esri |
| Cloud & Database Administrator | OCP - Oracle Certified Professional |
I work with Enterprise Geodatabases since 1997.
“ I do not fear computers. I fear the lack of them." Isaac Isimov
0 Kudos
clt_cabq
Occasional Contributor III

Thanks @MarceloMarques I suspected something along these lines was the correct approach, wanted to make sure I wasn't missing something though.