Collection Contents Index SYSFKCOL system table SYSGROUP system table pdf/chap15.pdf

Reference Manual
   CHAPTER 15. System Tables     

SYSFOREIGNKEY system table


Column name

Column type

Column constraint

Table constraints

foreign_table_id

SMALLINT

NOT NULL

Primary key, foreign key references SYS.SYSTABLE. table_id. Unique index.

foreign_key_id

SMALLINT

NOT NULL

Primary key

primary_table_id

SMALLINT

NOT NULL

foreign key references SYS.SYSTABLE. table_id.

root

INTEGER

NOT NULL

check_on_commit

CHAR(1)

NOT NULL

nulls

CHAR(1)

NOT NULL

role

CHAR(128)

NOT NULL

Unique index

remarks

LONG VARCHAR

A foreign key is a relationship between two tables—the foreign table and the primary table. Every foreign key is defined by one row in SYSFOREIGNKEY and one or more rows in SYSFKCOL. SYSFOREIGNKEY contains general information about the foreign key while SYSFKCOL identifies the columns in the foreign key and associates each column in the foreign key with a column in the primary key of the primary table.

foreign_table_id     The table number of the foreign table.

foreign_key_id     Each foreign key has a foreign key number that is unique with respect to:

primary_table_id     The table number of the primary table.

root     Foreign keys are stored in the database as B-trees. The root identifies the location of the root of the B-tree in the database file.

check_on_commit (Y/N)     Indicates whether INSERT and UPDATE commands should wait until the next COMMIT command to check if foreign keys are valid. A foreign key is valid if, for each row in the foreign table, the values in the columns of the foreign key either contain the NULL value or match the primary key values in some row of the primary table.

nulls (Y/N)     Indicates whether the columns in the foreign key are allowed to contain the NULL value. Note that this setting is independent of the nulls setting in the columns contained in the foreign key.

role     The name of the relationship between the foreign table and the primary table. Unless otherwise specified, the role name will be the same as the name of the primary table. The foreign table cannot have two foreign keys with the same role name.

remarks     A comment string.


Collection Contents Index SYSFKCOL system table SYSGROUP system table pdf/chap15.pdf