Comparison of Referential Integrity Constraint Types - 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™

The following table compares the three referential integrity constraint types supported by Vantage.

Referential Constraint Type DDL Definition Clause Does It Enforce Referential Integrity? Level of Enforcement
Standard REFERENCES Yes Single row
Batch REFERENCES WITH CHECK OPTION Yes All child table rows must match a parent table row.

The different types have different applications, as the following table documents.

Referential Constraint Type Application
Standard
  • Tests each individual inserted, deleted, or updated row for referential integrity.
  • Not valid for temporal tables.
  • If insertion, deletion, or update of a row would violate referential integrity, then AMP software rejects the operation and returns an error message.
  • Permits special optimization of certain queries.
Batch
  • Tests an entire insert, delete, or update request operation for referential integrity. In this context, a batch operation is defined as an implicit SQL transaction.
  • Not valid for temporal tables.
  • If the result of the request violates referential integrity, the system returns an error to the requestor.
  • Permits special optimization of certain queries.