1

When trying to delete records from a parent table, I'm getting an SQL Error:

[2292] [23000]: ORA-02292: integrity constraint (constraint_name) violated - child record found

though I don't find any records in the child table which the constraint is referring to.

Are there any other possibilities where we might face this error or how to make sure if the error is because of any other child table?

mustaccio
  • 18,234
  • 16
  • 48
  • 57
Sreenivas
  • 11
  • 1
  • 2
  • You can use the query mentioned [here](https://stackoverflow.com/questions/1143728/how-can-i-find-which-tables-reference-a-given-table-in-oracle-sql-developer) and list all the child tables depends on your table then you can look deeper in to your problem. – Eldar Dec 15 '19 at 19:02
  • Hi Eldar, I have checked child tables with a similar query and I made sure records from the child table with the constraint_name are deleted. Even then I'm facing the above mentioned error – Sreenivas Dec 16 '19 at 09:36

2 Answers2

0

You can use delete with cascade clause so that it will delete the record from the child table if any exists.

0

This means that the record you are trying to delete from the parent table has a link with the child table. cascade clause is one way to solve this. Cascade DELETE in SQL server see this

user2235747
  • 345
  • 6
  • 14