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


ORA- Error :


SQL> truncate table mis_report_new;
truncate table mis_report_new
*
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys


Cause :

Dependency of primary/unique column of the table being truncated is referenced by a table causing error ORA-02266 and denying the structural changes to the table while using truncate as DDL statement.

Solution :

Considering the dependency of primary/unique column is taken care by removal of the referenced key values, the error ORA-02266 can be avoid using delete DML statement.


SQL> delete from mis_report_new;

1872 rows deleted.

SQL> commit;

Commit complete.


No comments:

Post a Comment