Column referential constraints and table referential constraints

You can specify referential constraints associated with individual columns (column referential constraints), or with the entire table (table referential constraints).
  • A column referential constraint relates a column (the foreign key) in the table being created (the dependent table) to an equivalent column (the parent key) in another table (the parent table), and restricts non-null values of the foreign key column to the values of the parent key column.
  • A table referential constraint relates a set of columns (the foreign key) in the table being created (the dependent table) to an equivalent set of columns (the parent key) in another table (the parent table), and restricts non-null values of the foreign key to the values of the parent key.
Note:
  1. The parent key must be a primary or unique key on the parent table.
  2. If you do not specify the parent key column name (or names), the foreign key is related to the primary key of the parent table.

To specify column referential constraints, use the Column Referential Constraints panel.

The Column Referential Constraints panel shows the columns defined for the table you are creating. If you have used the modeling facility, the panel shows the column details for each column in the model table. You use this panel to specify information to define column referential constraints for the table you are creating. To define a referential constraint, you must at least specify the parent table name. To indicate a column does not have a referential constraint, leave all the fields for that column blank.

To specify table referential constraints, use the Table Referential Constraints panel. Each row of the panel defines a single table referential constraint.

You use the Table Referential Constraints panel to specify information to define table referential constraints for the table you are creating. To define a referential constraint, you must at least specify the parent table name.

The Create Table Referential Constraint panel is displayed if you enter S in the Cmd entry field.

The Create Table Referential Constraint panel shows the columns defined for the table you are creating (the dependent table). If you have used the modeling facility, the panel shows the column details for each column in the model table. You use this panel to select the dependent table columns (the foreign key) and specify the parent table columns (the parent key) to which they relate.

Related references