My Oracle Support Banner

ORA-2270 Cannot Add Foreign Key (Doc ID 165416.1)

Last updated on FEBRUARY 02, 2022

Applies to:

Oracle Database - Enterprise Edition - Version 7.0.16.0 to 11.2.0.2 [Release 7.0 to 11.2]
Information in this document applies to any platform.



Symptoms

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
catalog view

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.