4 Replies Latest reply on Mar 7, 2014 9:23 AM by CaitlindeLisser

    Relational Database Question



      Relational Database Question


           Hi all, 

           I have created a relational database that consists of many to one relationships (i.e. formatted it correctly), I  have linked them on the relational graph after putting in a primary and a foreign key into each, but the databases are still failing to link up. Is there an aspect that I have forgotten that is crucial in order to link up the parent and the child table? 





        • 1. Re: Relational Database Question

               In order for them to "link up" you need identical matching values in the pk and fk fields.

               For example, if you have a record in Date with _pkDateID = 365, then for it to link to a record in Orders, you need at least one record in orders with a value of 365 in the _fkDateID field.

               How you produce those records with matching values will depend on how you design your database layouts. A portal to Orders on the Dates layout could make the process of creating new Orders records linked to the current Dates record very simple, but this is not the only option.

          • 2. Re: Relational Database Question

                 Do I have to auto-input that key? that is the corresponding number? Or is there a way to run a script to do that based on if they have corresponding titles? 

            • 3. Re: Relational Database Question

                   _pk fields should auto-enter a value. The best field option to use in most situations is to set it up with an auto-entered serial number. The _fk fields would NOT auto-enter a serial number.

                   How you get matching values into the _fk fields will depend on how you want to set up your layouts. There are a number of different options from using portals, to formatting the _fk fields with drop down lists/pop up menus to using scripts, global variables and auto-enter calculations...

              • 4. Re: Relational Database Question

                     Okay, thank you!