Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » Context-Sensitive Help » SQL Anywhere plug-in help » Introduction to SQL Anywhere properties windows

 

Foreign Key Properties window: General tab

This tab has the following components:

Name   Shows the name of the foreign key. You can edit this field.

Type   Shows the type of object.

Unique   Shows whether the foreign key is unique.

Foreign table   Shows the name and owner of the table to which the foreign key applies.

Foreign index   Shows the name of the index used to enforce the foreign key.

Primary constraint   Shows the name of the primary key or unique constraint that the foreign key references.

Primary constraint type   Shows the type of constraint the foreign key references. This can only be a primary key or a unique constraint.

Primary table   Shows the table containing the primary key or unique constraint in this foreign key relationship.

Primary index   Shows the name of the index used to maintain the primary key or unique constraint.

Allows null   Determines whether the foreign key columns allow NULL values. To use this option, the foreign key columns must all have Allow Nulls set to Yes.

Match type   Shows the match type selected for the foreign key. The match type determines what is considered a match when using a multi-column foreign key where Null values are allowed. This only applies if the foreign key allows Null.

The possible match types are listed below.

  • Simple   A match occurs for a row in the referencing table if at least one column in the key is NULL, or all the column values match the corresponding column values present in a row of the referenced table.

  • Full   A match occurs for a row in the referencing table if all column values in the key are NULL, or if all of the column values match the values present in a row of the referenced table.

  • n/a   Not applicable. The foreign key does not allow Nulls.

Update action   Uses one of the following settings to define the behavior of the table when a user tries to update values in the foreign key.

  • Not permitted   Prevents updates of the associated primary table's primary key value if there are no corresponding foreign keys.

  • Cascade   Updates the foreign key to match a new value for the associated primary key.

  • Set to null   Sets all the foreign key values that correspond to the updated primary key of the associated primary table to NULL.

    To use this option, the foreign key columns must all have Allow Nulls set to Yes.

  • Set Default   Sets foreign key values that match the updated or deleted primary key value to values specified in the DEFAULT clause of each foreign key column. To use this option, the foreign key columns must all have default values.

Delete action   Uses one of the following settings to define the behavior of the table when a user tries to delete data.

  • Not permitted   Prevents deletion of the associated primary table's primary key value if there are no corresponding foreign keys in the table.

  • Cascade   Deletes the rows from the table that match the deleted primary key of the associated primary table.

  • Set values to NULL   Sets all the foreign key values in the table that correspond to the deleted primary key of the associated primary table to NULL.

    To use this option, the foreign key columns must all have Allow Nulls set to Yes.

  • Set Default   Sets foreign key values that match the updated or deleted primary key value to values specified in the DEFAULT clause of each foreign key column. To use this option, the foreign key columns must all have default values.

Check on commit   Forces the database to wait for a COMMIT before checking the integrity of the foreign key, overriding the setting of the wait_for_commit database option. To change this setting, click Change. See wait_for_commit option [database].

Change   Opens the Change Settings window where you can change the settings for this primary key.

Comment   Provides a place for you to type a text description of the foreign key. For example, you could use this area to describe the foreign key's purpose in the system.

See also