ORA-2270 Cannot Add Foreign Key
(Doc ID 165416.1)
Last updated on FEBRUARY 02, 2022
Applies to:Oracle Database - Enterprise Edition - Version 184.108.40.206 to 220.127.116.11 [Release 7.0 to 11.2]
Information in this document applies to any platform.
You are trying to add a foreign key to a child table. The foreign key is not
based on the parent tables primary key, but rather unique columns. You have created
a unique index on the parent table for those columns, but you still get the error
while trying to add the foreign key.
ORA-2270 "no matching unique or primary key for this column-list"
*Cause: A REFERENCES clause in a CREATE/ALTER TABLE statement
gives a column-list for which there is no matching unique or primary
key constraint in the referenced table.
*Action: Find the correct column names using the ALL_CONS_COLUMNS
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!