SQL Anywhere Studio Help
Adaptive Server Anywhere Help
Introduction to property sheets
Foreign Key property sheet
The General tab of the Foreign Key property sheet has the following components:
Name Shows the name of the foreign key. You can change the name of the foreign key in this field.
Type Shows the type of object.
Table Shows the name of the table the foreign key belongs to, as well as the table's owner.
Foreign table The table containing the foreign key.
Primary table The table containing the primary key in the foreign key relationship.
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.
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.
Update action Defines the behavior of the table when a user tries to update data with one of the following values.
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 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 Defines the behavior of the table when the user tries to delete data with one of the following values.
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.
Clustered Shows whether the primary or foreign table uses a clustered index. Clustered indexes are supported for Adaptive Server Anywhere databases that are version 8.0.2 and higher.
Clustered indexes in Adaptive Server Anywhere store the table rows in approximately the same order as they appear in the corresponding index. Using a clustered index can lead to performance benefits by reducing the number of times each page needs to be read into memory. Only one index on a table can be a clustered index.
For more information about clustered indexes, see CREATE INDEX statement.
Set Clustered Index Now Opens the Set Clustered Index dialog where you can specify that an index on the primary or foreign table is a clustered index.
Index type Shows the type of index the table has.
For more information about indexes, see Indexes.
Maximum hash size This information only appears for databases that are created with Adaptive Server Anywhere 7 or earlier. The hash size is the number of bytes used to store a value in an index.
Adaptive Server Anywhere version 6 and 7 databases use regular B-tree indexes with a hash size of 10.
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.