Chapter 15 System Tables
1011
SYSFOREIGNKEY system table
Column name Column type
Column
constraint
Table constraints
foreign_table_id UNSIGNED INT NOT NULL Primary key, foreign
key references
SYSTABLE.table_id.
Unique index.
foreign_key_id SMALLINT NOT NULL Primary key
primary_table_id UNSIGNED INT NOT NULL foreign key
references
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:
♦ The key number of all other foreign keys for the foreign table
♦ The key number of all foreign keys for the primary table
♦ The index number of all indexes for the foreign table
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.