


The Foreign Key object defines existence dependencies between the rows of two tables. A Foreign Key is created within the table design.
Relationships between a foreign key and other objects:
1. Foreign Key Uses Column
2. Foreign Key Refers to Table
1. A foreign key contains one or more table columns; one table column can be part of a foreign key (0-N).
2. A foreign key refers to exactly one primary table; a table's primary key can be assigned to the foreign key of another table (0-1).
Generally speaking, Foreign Keys are considered within the context of the primary or foreign table, i.e., within the context of a table; however, it is also useful to be able to list all Foreign Key names as an overview (e.g., to check naming conventions).
Select the Object / List All Objects or Object / List Own Objects menu function to display the standard lists for a Foreign Key (see Section Object Lists). When you select the Object / Select Objects function, a dialog box for entering search arguments is displayed. The owner and table name arguments describe the foreign table or the referencing table.
If the foreign key name was not explicitly specified during definition, ADABAS generates this name from the names of the primary table and foreign table so that you will be able to recognize which two tables are linked by this foreign key.
From the Foreign Key list, click on the
toolbar button or select the Object / Design function to activate design mode for the associated foreign table.
This opens the Foreign Keys card.
Click on the
toolbar button (Object / New function) to display a dialog box for selecting a table list. When you select a table from the table list, design mode is
activated for the table. This opens the Foreign Keys card.
The Foreign Key is defined as described in Section Table.


