16.10 - Circular References - Teradata Database

Teradata Database SQL Fundamentals

Teradata Database
Release Number
June 2017
Content Type
Programming Reference
Publication ID
English (United States)
Last Update

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.