Contents Index SYSFKCOL system table SYSGROUP system table

ASA SQL Reference
  System Tables

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
primary_index_id UNISGNED INT NOT NULL
fk_not_enforced CHAR(1) NOT NULL
hash_limit SMALLINT NOT NULL

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.

primary_index_id    The index_id of the primary key, or root if the primary key is part of a combined index.

fk_not_enforced (Y/N)    Is N if one of the tables is remote.

hash_limit    Contains information about physical index representation.


Contents Index SYSFKCOL system table SYSGROUP system table