What is a relationship between tables?
Relationship are used to join different tables together base on key fields. Relationship can be between one to one table or one to many tables.
NOTE: To use the Build export function to add relationships between tables in an export. The export needs to have been created by a template or by the Build export function. This will not work for any export that has be build using Custom SQLs
Adding a Relationship
Once you have added tables and selected fields within those tables for the export, relationships between the tables must be specified.
- Select the Options button at the top of the command screen
- From the drop down menu select Relationships.
- When the table relationships screen is displayed, select Add.
- Once the add button has been selected the Relationship Edit screen is shown. This is where the relationship between tables must be specified.
NOTE: The alias name is used if a field name is the same in more than one table.
- The relationship join Type is also determined here.
- Inner Join: Only include records where the joining fields are equal,
- Left Outer: Include all records from the 'left' table and any matching records from the 'right'
- Right Outer: Include all records from the 'right' table and any matching records from the 'left'
- Click on Save
- Once the relationship has been saved it will be shown as follows in the Table relationship screen. The Join Type shown will depend upon which option was chosen when defining the Type
- If there are more tables selected in this command the relationships between those table can also be added.
- Once all of the relationships have been defined click on the Close button
- Under the Export Command Summary section you can see how many relationships have been added. Click on the link to access them.