Rules for Using Referential Constraints - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
Product Category
Teradata Vantage™

Other than their not actually enforcing referential integrity, most of the rules for Referential Constraints are identical to those documented by FOREIGN KEY Constraints and REFERENCES constraints.

The exceptions are documented by the following set of rules that apply specifically to the specification and use of Referential Constraints.
  • You can specify Referential Constraints for both of the following constraint types.
    • FOREIGN KEY (FK_column_set) REFERENCES (parent_table_PK_column_set)
    • (NFK_column_set) REFERENCES (parent_table_AK_column_set)

      where NFK indicates non-foreign key and parent_table_AK_column_set indicates an alternate key in the parent table.

  • Referential Constraint references count toward the maximum of 64 references permitted for a table referenced as a parent even though they are not enforced by the system.
  • INSERT, DELETE, and UPDATE statements are not permitted against tables with unresolved, inconsistent, or non-valid Referential Constraints. This rule is identical to the rule enforced for standard and batch RI.
  • The candidate key acting as the primary key in the referenced table in the constraint need not be explicitly declared to be unique using the PRIMARY KEY or UNIQUE keywords or by declaring it to be a USI in the table definition.