What does No matching unique or primary key for this column list?

What does No matching unique or primary key for this column list?

Conclusion: A foreign key must always refer to a column or columns declared as either PRIMARY KEY or UNIQUE in Oracle. Fullname etc. are not declared as unique in the parent table, and therefore you can’t reference them from the child table.

What is foreign key constraint?

A foreign key constraint specifies that the key can only contain values that are in the referenced primary key, and thus ensures the referential integrity of data that is joined on the two keys. You can identify a table’s foreign key when you create the table, or in an existing table with ALTER TABLE .

Why do I get an ora-02270 error in Oracle?

Learn the cause and how to resolve the ORA-02270 error message in Oracle. When you encounter an ORA-02270 error, the following error message will appear: You tried to reference a table using a unique or primary key, but the columns that you listed did not match the primary key, or a primary key does not exist for this table.

Why is there no matching or primary key for this column list?

ORA-02270: no matching unique or primary key for this column-list 02270. 00000 – “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.

Why do I get an oracle error when I try to reference a table?

You tried to reference a table using a unique or primary key, but the columns that you listed did not match the primary key, or a primary key does not exist for this table. The option (s) to resolve this Oracle error are: This error commonly occurs when you try to create a foreign key that references a table that doesn’t have a primary key.

How to fix no matching unique or primary key for?

Having assumption that both the primary key we see in your code has different purpose and you want to have value in PRODUCTTYPE and CODESECTION column to be checked against value in DATACODE as to fulfill some integrity, you need to create an unique constraint on the DATACODE column and then the foreign key reference to it, How to fix it?