Jump to content
Sign in to follow this  
Sam Durham

Creating pk and fk links in uploaded data

Recommended Posts

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Can you provide a more detailed explanation of your current process, preferably with a small example? 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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