Saturday, March 1, 2014

this unique/primary key is referenced by some foreign keys

Sometimes while trying to drop the constraint we may encounter some issues as described below

SQL Error: ORA-02273: this unique/primary key is referenced by some foreign keys
02273. 00000 -  "this unique/primary key is referenced by some foreign keys"
*Cause:    Self-evident.
*Action:   Remove all references to the key before the key is to be dropped.

This issue can be fixed by adding the keyword 'CASCADE' at the end of the contraint drop statement

ALTER TABLE USER DROP CONSTRAINT USER_CON CASCADE;