Add Foreign Key - Infopops

Specifies the schema of the parent table or nickname.

The parent table or nickname must have a primary key. The foreign key specified for the table or nickname being created must have the same number of columns as the primary key of its parent table or nickname. Furthermore, the nth column in the foreign key must be compatible in terms of data type with the nth column of the primary key of its parent table or nickname.

To modify, click the down arrow to display a list of existing schemas and select one, or type the name of schema for the parent table or nickname in the box. You can specify an ordinary or delimited identifier.

Specifies the name of the parent table or nickname. The parent table or nickname must have a primary key. The foreign key specified for the table or nickname being created must have the same number of columns as the primary key of its parent table or nickname. Furthermore, the nth column in the foreign key must be compatible in terms of data type with the nth column of the primary key of its parent table or nickname.

To modify, click the down arrow to display a list of existing schemas and select one, or type the name of the parent table or nickname in the box. You can specify an ordinary or delimited identifier.

Lists all of the columns defined as primary key columns in the parent table or nickname. The primary key columns are listed in order of significance.

Use this box to view the list of primary key columns for the parent table or nickname. The foreign key columns that you select in the Available columns box must match the columns for the primary key in meaning and data type for the parent table or nickname.

Lists all of the columns defined for the table or nickname. Use this list to select the column or columns that you want to define as foreign key columns and then click the > push button. Each column that you select must match a column listed in the Primary key box in meaning and data type. You can select one or more columns at the same time.

Attention: You cannot define columns of data type LOB, LONG VARCHAR, or LONG VARGRAPHIC to be part of a foreign key.

Moves the selected columns in the Available columns box to the Foreign key box.

Moves all columns displayed in the Available columns box to the Foreign key box.

Moves the selected columns in the Foreign key box to the Available columns box.

Moves all columns displayed in the Foreign key box to the Available columns box.

Lists all of the columns defined as foreign key columns. Use this box to view the list of foreign key columns or to select a column or columns to remove from the list with the < push button.

To add a column to this list, select a column from the Available columns box and then click the > push button.

Optional: Specifies what action is to take place on the dependent table when a row of the parent table is deleted. NO ACTION: Specifies that an error occurs for the DELETE operation on the parent table and no rows are deleted. A delete rule of NO ACTION is enforced after other referential constraints. NO ACTION is the default. RESTRICT: Specifies that an error occurs for the DELETE operation on the parent table and no rows are deleted. A delete rule of RESTRICT is enforced before all other constraints. CASCADE: Specifies that the delete operation is propagated to the dependents of the deleted row in the parent table. SET NULL: Speficies each nullable foreign key column is set to null when the corresponding row is deleted in the dependent table; other columns left unchanged.

Specifies what action is to take place on the dependent table when a row of the parent table is updated. Click the down arrow and select an action. NO ACTION: Specifies that an error occurs for the UPDATE operation on the parent table and no rows are updated. An update rule of NO ACTION is enforced after other referential constraints. NO ACTION is the default. RESTRICT: Specifies that an error occurs for the UPDATE operation on the parent table and no rows are updated. An update rule of RESTRICT is enforced before all other constraints.

Shows the default name for the foreign key. You can use the default name or type a different name. The name of the foreign key cannot be more than 18 characters.

Select to specify that the query optimizer can use the foreign key to evaluate the access plans for queries that include the nickname.