Jump to content
Server Maintenance This Week. ×

Creating pk and fk links in uploaded data


This topic is 1891 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Sorry if this is evident as I am a new to FMP, but I haven't been able to find a 'how to' for this

So I have some large data tables that I have uploaded from Excel to FM with Primary Key (pk) and Foreign Key (fk) fields.  All the primes have UUID data. and I create the relationships.  Now in order for it to work I have to copy the pk data in the parent table into the related fk fields in the child tables.  It works, but is there an easier way to do this?  The only way I can see is to do it manually which will take ages.  There must be a better way that I am missing.

Sam

Link to comment
Share on other sites

If you import the child table first and the data set already has a foreign key - or natural or unique values that can be used as a temporary foreign key then you can import the child and loop thru the records to create a "parent" record.

In some cases the data set (child has enough fields that concatenated together can substitute temporarily for a foreign key ) to also make  finding matching values you could  use   GetContainerAttribute ( Lower ( fieldA & fieldB & fieldC ) ; "md5" ) to use as a way to create a parent record. Once the parent record is created (establishing a UUID) do a replace on the child table for the permanent foreign key then adjust the relationship.

Link to comment
Share on other sites

This topic is 1891 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.