Referential Integrity When a Table Is Inconsistent - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
jpx1556733107962.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1184
lifecycle
previous
Product Category
Teradata Vantage™

While a table is marked as inconsistent, no updates, inserts, or deletes are permitted. The table is fully usable only when the inconsistencies are resolved. This restriction is true for both hard and soft (Referential Constraint) referential integrity constraints.

It is possible that the user either intends to or must revert to a definition of a table which results in an inconsistent reference on that table. The Archive and Restore operations are the most common cause of such inconsistencies.

After the child table is archived, the parent table can be dropped.

When the child table is restored, the parent table no longer exists. The normal ALTER TABLE DROP FOREIGN KEY request does not work, because the parent table references cannot be resolved.

You can use the DROP INCONSISTENT REFERENCES option to remove these inconsistent references from a table.

The syntax is as follows.

     ALTER TABLE  database_name.table_name  DROP INCONSISTENT REFERENCES

You must have DROP privilege on the target table of the request to perform this option, which removes all inconsistent internal indexes used to establish references.