Link to Related Tables
Once you are displaying a table, you can display rows in other related tables. This is shown as follows:
Related Tables
In order to use this feature, your table must have a number of relationships to other tables. There are two ways a table relationship can be established:
- it can be defined to the database as a Foreign Key relationship.
- You can see existing Foreign Key relationships by, from the Database Explorer, right-click a table then selecting Dependent Tables or Related Tables. Some databases (such as MS Access and MySQL V4) do not support Foreign Keys.
- You can define a new Foreign Key by, from the Database Explorer, select a table, then clicking on Create > Foreign Key in the Admin Toolbar.
- it can be defined to AQT as a User-Defined Relationship. This feature of AQT allows you to define relationships between tables, when they are not defined to the database. Click on Link > Edit List of Related tables to edit the list of User-Defined Relationships.
Showing Related Tables
To show the data from related tables, click on the Link toolbar button, Link > Link to Related Tables menu item, or hit Ctrl+F2. AQT will show the Related Tables panel at the bottom of the window:
- the related tables will be shown in the drop-down box. Select the table relationship you wish to view.
- alternatively, you can click on the button with three dots. This will show you all the related tables, and the details of the relationships. If your table has many relationships, this is useful for selecting the relationship you wish to view. Click on a relationship then click on the OK button. You can also double-click a relationship to select it.
- as you select a relationship, the relationship description is given to the right of the drop-down box. For Foreign Key relationships, this description is the Constraint Name. For User-Defined Relationships, this description is as given when the relationship is defined.
- as you click on rows in the main grid, the matching rows from the related table are shown in the lower grid. The SQL that AQT has used to get these rows is shown in the bottom status-bar.
- AQT doesn't provide many options for "doing" things with the related rows (eg. copying, showing row detail etc). If you wish to deal with this data further, click on Copy to another window. This copies the rows to their own Data Display window - from this you can copy / export / update the rows, or link to another table.
- The New option specifies whether a new window is created every time you click on Copy to another window. By default it isn't - a new window is created once (when you first click on Copy to another window) - when you click on Copy to another window a second time, the existing related-table window is re-used.