16.10 - Circular References - Teradata Database

Teradata Database SQL Fundamentals

Product
Teradata Database
Release Number
16.10
Published
June 2017
Language
English (United States)
Last Update
2018-04-25
dita:mapPath
klx1480972732157.ditamap
dita:ditavalPath
changebar_rev_16_10_exclude_audience_ie.ditaval

References can be defined as circular in that Table A can reference Table B, which can reference Table A. In this case, at least one set of FOREIGN KEYS must be defined on nullable columns.

If the FOREIGN KEYS in Table A are on columns defined as nullable, then rows could be inserted into Table A with nulls for the FOREIGN KEY columns. Once the appropriate rows exist in Table B, the nulls of the FOREIGN KEY columns in Table A could then be updated to contain values that are not null that match the Table B values.