Change Foreign Key -- Fields and controls

" " Table schema
" " Table name
" " Primary key
" " Available columns
" " >, >>, <, <<
" " Foreign key
" " On delete
" " On update
" " Constraint name
" " OK
" " Cancel



" " Table schema

This box contains the schema currently specified for the parent table.

To specify a different table's schema, use one of these methods:

You can specify an ordinary or delimited identifier.

" " Table name

This box contains the name currently specified for the parent table. To specify a different table, use one of these methods:

You can specify an ordinary or delimited identifier.

" " Primary key

This box lists all of the columns defined as primary key columns in the parent table. The list is ordered.

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

" " Available columns

This box lists all of the columns in the table not currently defined as foreign keys. Use this box to select the column or columns that you want to define as foreign key columns and then click on the > push button. Each column 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.

" " >, >>, <, <<

Use these push buttons to change the list of columns displayed in the Available columns and Foreign key boxes. You can use:

>
To move the selected columns in the Available columns box to the Foreign key box.

>>
To move all columns displayed in the Available columns box to the Foreign key box.

<
To move the selected columns in the Foreign key box to the Available columns box.

<<
To move all columns displayed in the Foreign key box to the Available columns box.

" " Foreign key

This box lists all of the columns currently 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 on the > push button.

" " On delete

This box specifies the action that takes place on the dependent table when a row of the parent table is deleted. To change the specified action, click on the down arrow and select one of the following actions:

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
Specifies that each nullable column of the foreign key of each dependent of the deleted row is set to null. Do not specify this action unless some column of the foreign key allows null values.

" " On update

This box specifies the action that takes place on the dependent table when a row of the parent table is updated. To change the specified action, click on the down arrow and select one of the following actions:

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.

" " Constraint name

This field displays the constraint name currently specified for the foreign key. To change the constraint name, type the new name for the constraint that you're defining. This name: