My code is working, but for my own edification I'm trying to understand the documentation because there's four options for adding keys and I don't really get the difference between the two origin key options and the two destination key options.
https://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-relationship-class.htm
Right now my code uses the origin_primary_key and the destination_primary_key. I'm wondering why there is an option for an origin_foreign_key and destination one. The descriptions don't make much sense to me, for instance the origin descriptions are this:
PK:
The field in the origin table, typically the OID field, that links to the Origin Foreign Key field in the relationship class table.
FK:
The field in the relationship class table that links it to the Origin Primary Key field in the origin table.
What is a "relationship class table"?
Additionally, I see that both the destination keys are optional. Don't you need to have a key in the destination table to relate it the origin table? How can that be an optional parameter? I played around with the code and only used the required options (origin PK and origin FK) and it didn't seem to make a difference from when I used the origin PK and destination PK. Just curious how these are all different?
Solved! Go to Solution.
Hi Molly,
These additional keys are used for the intermediate table in a many to many relationship. If you are using one to many or one to one, they are not needed. See:
I hope this helps!
Colin
Hi Molly,
These additional keys are used for the intermediate table in a many to many relationship. If you are using one to many or one to one, they are not needed. See:
I hope this helps!
Colin