ORA-02292: integrity constraint violated - child record found
OracleWhat does it mean?
A parent row was deleted or its key changed, but the foreign key constraint did not allow it because dependent child records exist.
Why does it happen?
Trying to DELETE a parent row that has records in the child table; the FK is defined without ON DELETE CASCADE; dependent records were not cleaned up first.
How to fix it
First delete the dependent child records or move them to another parent record, then delete the parent row. If the business rule allows it, recreate the foreign key with ON DELETE CASCADE: ALTER TABLE child DROP CONSTRAINT fk_name; ALTER TABLE child ADD CONSTRAINT fk_name FOREIGN KEY (my_column) REFERENCES parent(key_col) ON DELETE CASCADE; To find dependent rows, query the child table by the parent key.
More from this engine
- ORA-01438value larger than specified precision allowed for this column
- ORA-01400cannot insert NULL into (column)
- ORA-02291integrity constraint violated - parent key not found
- ORA-00979not a GROUP BY expression
- ORA-00918column ambiguously defined
- ORA-06550line/column PLS-... PL/SQL compilation error
- ORA-04068existing state of packages has been discarded