SYSCST

The SYSCST view contains one row for each constraint in the SQL schema.

The following table describes the columns in the SYSCST view:

Table 1. SYSCST view
Column Name System Column Name Data Type Description
CONSTRAINT_SCHEMA CDBNAME VARCHAR(128) Name of the schema containing the constraint.
CONSTRAINT_NAME RELNAME VARCHAR(128) Name of the constraint.
CONSTRAINT_TYPE TYPE VARCHAR(11) Constraint Type
  • CHECK
  • UNIQUE
  • PRIMARY KEY
  • FOREIGN KEY
TABLE_SCHEMA TDBNAME VARCHAR(128) Name of the schema containing the table.
TABLE_NAME TBNAME VARCHAR(128) Name of the table which the constraint is created over. This will be the SQL table name if it exists; otherwise, it will be the system table name.
IS_DEFERRABLE ISDEFER VARCHAR(3) Indicates whether the constraint checking can be deferred. Will always be 'NO'.
INITIALLY_DEFERRED INITDEFER VARCHAR(3) Indicates whether the constraint was defined as initially deferred. Will always be 'NO'.
SYSTEM_TABLE_NAME SYS_TNAME CHAR(10) System name of the table.
SYSTEM_TABLE_SCHEMA SYS_DNAME CHAR(10) System name of the schema containing the table.
CONSTRAINT_KEYS COLCOUNT SMALLINT
Nullable
Specifies the number of key columns if this is a UNIQUE, PRIMARY KEY, or FOREIGN KEY constraint.

Contains the null value if the constraint is a CHECK constraint.

IASP_NUMBER IASPNUMBER SMALLINT Specifies the independent auxiliary storage pool (IASP) number.
CONSTRAINT_STATE CST_STATE VARCHAR(11) Indicates whether the constraint is established or defined:
ESTABLISHED
The referential constraint is established. The parent table exists.
DEFINED
The referential constraint is defined. The parent table does not exist.
ENABLED ENABLED VARCHAR(3)
Nullable
Indicates whether the constraint is enabled:
NO
The constraint is disabled.
YES
The constraint is enabled.

Contains the null value if the constraint is defined or is a unique constraint.

CHECK_PENDING CHECKFLAG VARCHAR(3)
Nullable
Indicates whether the constraint is in check pending state:
NO
The constraint is not in check pending.
YES
The constraint is in check pending.

Contains the null value if the constraint is defined, disabled, or is a unique constraint.

CONSTRAINT_TEXT LABEL VARGRAPHIC(50) CCSID 1200
Nullable
A character string provided with the LABEL statement.

Contains the null value if there is no label.

LONG_COMMENT REMARKS VARGRAPHIC(2000) CCSID 1200
Nullable
A character string supplied with the COMMENT statement.

Contains the null value if there is no long comment.

SYSTEM_CONSTRAINT_SCHEMA SYS_CDNAME CHAR(10) Name of the system schema containing the constraint.