


When you click on the Foreign Keys card, the Foreign Key Definition window is displayed.
A foreign key links two tables such that the primary key (or the identifying columns) of the primary table appears in the secondary table. The primary table is the referenced table; it must already exist in order for the foreign key to be defined.

Once again, you have the option of entering the names directly in tabular form or allowing DOMAIN to assist you. When entering the names in tabular form, you must enter the column names, separated by semicolons, under the Referencing Columns and Referenced Columns headings. As in the case of primary key definitions, DOMAIN displays the columns of the primary or foreign table for the relevant selection. DOMAIN then displays the selected columns in tabular form.
In the case of Referencing Columns, the columns of the current table are displayed so that you can select the corresponding foreign key columns.

In the case of the Referenced Table, a dialog box is displayed containing a list of tables from which you can select the relevant primary table.

Once a Referenced Table is defined, DOMAIN automatically transfers the key columns of the Referenced Table to Referenced Columns. If you do not wish to retain these
columns, click on the
button to change to selection mode. You can then select the desired Referenced Columns as well as the Referencing Columns.
To delete a Foreign Key, delete the definition from the table display.


