Thursday, April 24, 2014

Drop table commands ends up with ORA-02449

Hello,

Many may have noticed that when you try to drop table we face ORA-02449 error. This is due to the primary key in the table which is referring to the foreign key of another table.

Error occurred is :

ORA-02449: unique/primary keys in table referenced by foreign keys


To overcome this situation, make sure you do not need this table. And then fire below command to delete the table. This drop statement with cascade constraints option will delete the primary key constraints from the table and drop the table.


DROP TABLE EMP CASCADE CONSTRAINTS;