Select to view content in your preferred language

appending to feature class and related tables

528
2
01-17-2024 11:11 AM
Labels (3)
clt_cabq
Frequent Contributor

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 | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |
0 Kudos
clt_cabq
Frequent Contributor

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