Skip to main content

INFORMATION.SCHEMA.REFERENTIALCONSTRAINTS

Class INFORMATION.SCHEMA.REFERENTIALCONSTRAINTS Extends %Library.Persistent [ ClassType = persistent, Final, Owner = {_PUBLIC}, SqlRowIdPrivate, SqlTableName = REFERENTIAL_CONSTRAINTS, StorageStrategy = SQLStorage, System = 4 ]

Returns one row for each FOREIGN KEY table constraint in the current namespace for tables that can be accessed by the current user in the current namespace. The REFERENTIAL_CONSTRAINTS table has one row for each row in the TABLE_CONSTRAINTS table that has a CONSTRAINT_TYPE value of "FOREIGN KEY".

Parameters

READONLY

Parameter READONLY = 1;

Properties

SchemaExact

Property SchemaExact As %String(MAXLEN = 128) [ Internal, Private, Required, SqlColumnNumber = 20 ];

TableExact

Property TableExact As %String(MAXLEN = 128) [ Internal, Private, Required, SqlColumnNumber = 21 ];

ConstraintExact

Property ConstraintExact As %String(MAXLEN = 128) [ Internal, Private, Required, SqlColumnNumber = 22 ];

SystemTable

Property SystemTable As %Integer [ Calculated, Internal, Private, Required, SqlColumnNumber = 23, SqlComputeCode = { set {*}=$s($e({SchemaExact})="%"||({SchemaExact}="INFORMATION_SCHEMA"):1,1:0) }, SqlComputed ];

Is the table a system table (1 or 0)

CONSTRAINTCATALOG

Property CONSTRAINTCATALOG As %String(MAXLEN = 128) [ Calculated, SqlColumnNumber = 2, SqlComputeCode = { set {*}=""}, SqlComputed, SqlFieldName = CONSTRAINT_CATALOG ];

Catalog qualifier - always NULL in InterSystems IRIS.

CONSTRAINTSCHEMA

Property CONSTRAINTSCHEMA As %String(COLLATION = "Upper", MAXLEN = 128) [ SqlColumnNumber = 3, SqlFieldName = CONSTRAINT_SCHEMA ];

Name of schema that contains the foreign key constraint.

CONSTRAINTTABLENAME

Property CONSTRAINTTABLENAME As %String(COLLATION = "Upper", MAXLEN = 128) [ Required, SqlColumnNumber = 4, SqlFieldName = CONSTRAINT_TABLE_NAME ];

Name of the table that contains the foreign key constraint.

CONSTRAINTNAME

Property CONSTRAINTNAME As %String(COLLATION = "Upper", MAXLEN = 128) [ SqlColumnNumber = 5, SqlFieldName = CONSTRAINT_NAME ];

Foreign key constraint name.

UNIQUECONSTRAINTCATALOG

Property UNIQUECONSTRAINTCATALOG As %String(MAXLEN = 128) [ Calculated, SqlColumnNumber = 6, SqlComputeCode = { set {*}="" }, SqlComputed, SqlFieldName = UNIQUE_CONSTRAINT_CATALOG ];

Unique Constraint qualifier - always NULL in InterSystems IRIS.

UNIQUECONSTRAINTSCHEMA

Property UNIQUECONSTRAINTSCHEMA As %String(COLLATION = "Upper", MAXLEN = 128) [ Required, SqlColumnNumber = 7, SqlFieldName = UNIQUE_CONSTRAINT_SCHEMA ];

Name of the schema that contains the unique constraint the foreign key references.

UNIQUECONSTRAINTTABLE

Property UNIQUECONSTRAINTTABLE As %String(COLLATION = "Upper", MAXLEN = 128) [ Required, SqlColumnNumber = 8, SqlFieldName = UNIQUE_CONSTRAINT_TABLE ];

Name of the table that contains the unique constraint the foreign key references.

UNIQUECONSTRAINTNAME

Property UNIQUECONSTRAINTNAME As %String(COLLATION = "Upper", MAXLEN = 128) [ Required, SqlColumnNumber = 9, SqlFieldName = UNIQUE_CONSTRAINT_NAME ];

Name of the unique constraint the foreign key constraint references.

MATCHOPTION

Property MATCHOPTION As %String(MAXLEN = 7, VALUELIST = ",NONE,PARTIAL,FULL") [ Calculated, SqlColumnNumber = 10, SqlComputeCode = { set {*}="NONE" }, SqlComputed, SqlFieldName = MATCH_OPTION ];

The values of MATCH_OPTION have the following meanings:

  • NONE - No match type was specified.
  • PARTIAL - A match type of partial was specified.
  • FULL - A match type of full was specified. For InterSystems IRIS MATCH_OPTION is always NONE.

UPDATERULE

Property UPDATERULE As %String(MAXLEN = 11, VALUELIST = ",CASCADE,SET NULL,SET DEFAULT,RESTRICT,NO ACTION") [ Required, SqlColumnNumber = 11, SqlFieldName = UPDATE_RULE ];

The values of UPDATE_RULE have the following meanings for foreign keys constraints:

  • NO ACTION - A referential action of NO ACTION was specified.
  • SET NULL - A referential action of SET NULL was specified.
  • SET DEFAULT - A referential action of SET DEFAULT was specified.
  • RESTRICT - A referential action of RESTRICT was specified.
  • CASCADE - A referential action of CASCADE was specified.

DELETERULE

Property DELETERULE As %String(MAXLEN = 11, VALUELIST = ",CASCADE,SET NULL,SET DEFAULT,RESTRICT,NO ACTION") [ Required, SqlColumnNumber = 12, SqlFieldName = DELETE_RULE ];

The values of DELETE_RULE have the following meanings for foreign keys constraints:

  • NO ACTION - A referential action of NO ACTION was specified.
  • SET NULL - A referential action of SET NULL was specified.
  • SET DEFAULT - A referential action of SET DEFAULT was specified.
  • RESTRICT - A referential action of RESTRICT was specified.
  • CASCADE - A referential action of CASCADE was specified.

Methods

UPDATERULELogicalToStorage

ClassMethod UPDATERULELogicalToStorage(%val As %String) As %Integer [ Internal ]

0 = KeyCascade, 1 = KeyRestrict, 2 = SetNull, 3 = NoAction, 4 = SetDefault

UPDATERULEStorageToLogical

ClassMethod UPDATERULEStorageToLogical(%val As %String) As %Integer [ Internal ]

0 = KeyCascade, 1 = KeyRestrict, 2 = SetNull, 3 = NoAction, 4 = SetDefault

DELETERULELogicalToStorage

ClassMethod DELETERULELogicalToStorage(%val As %String) As %Integer [ Internal ]

0 = KeyCascade, 1 = KeyRestrict, 2 = SetNull, 3 = NoAction, 4 = SetDefault

DELETERULEStorageToLogical

ClassMethod DELETERULEStorageToLogical(%val As %String) As %Integer [ Internal ]

0 = KeyCascade, 1 = KeyRestrict, 2 = SetNull, 3 = NoAction, 4 = SetDefault