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

By [)ia6l0 iii

The error means that you attempted to truncate a table with unique/primary key that is referenced as foriegn key in another table.

In case you are sure that you do not want to delete the constraint, you can disable it.

ALTER TABLE tablename DISABLE CONSTRAINT constraintname;
TRUNCATE TABLE tablename;
ALTER TABLE tablename ENABLE CONSTRAINT constraintname;

Ensure that you enable it back after the truncate.
ORA-02266: unique/primary keys in table referenced by enabled foreign keys.

Related FAQs

The compound operator in SQL Server 2008 offers the simpler syntax which all developers looked for.
ORA-02266: unique/primary keys in table referenced by enabled foreign keys.  (2927 Views)