DB2 Universal Database for iSeries SQL Reference

SQLFOREIGNKEYS

The SQLFOREIGNKEYS view contains one row for every referential constraint key on a table. The following table describes the columns in the view:

Table 138. SQLFOREIGNKEYS view

Column Name Data Type Description
PKTABLE_CAT VARCHAR(128) Relational database name
PKTABLE_SCHEM VARCHAR(128) Name of the SQL schema containing the parent table.
PKTABLE_NAME VARCHAR(128) Parent table name.
PKCOLUMN_NAME VARCHAR(128) Parent key column name.
FKTABLE_CAT VARCHAR(128) Relational database name
FKTABLE_SCHEM VARCHAR(128) Name of the SQL schema containing the dependent table of the referential constraint.
FKTABLE_NAME VARCHAR(128) Dependent table name of the referential constraint.
FKCOLUMN_NAME VARCHAR(128) Dependent key name.
KEY_SEQ SMALLINT The position of the column within the key.
UPDATE_RULE SMALLINT Update Rule.

1
RESTRICT

3
NO ACTION
DELETE_RULE SMALLINT Delete Rule:

0
CASCADE

1
RESTRICT

2
SET NULL

3
NO ACTION

4
SET DEFAULT
FK_NAME VARCHAR(128) Name of the referential constraint
PK_NAME VARCHAR(128) Name of the unique constraint
DEFERRABILITY SMALLINT Indicates whether the constraint checking can be deferred. Will always be 7.
UNIQUE_OR_PRIMARY CHAR(7) Indicates the type of parent constraint:

PRIMARY
The parent constraint is a primary key.

UNIQUE
The parent constraint is a unique constraint.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]