Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

Cannot delete or update a parent row: a foreign key constraint fails

$
0
0

This is a scenario

Table (Telephone)

  • id
  • Number

Table (Person_has_Telephone)

  • Person_id(PK)
  • Telephone_id(PK)
    • Constraint - Table Telephone

....

Delete all Person_has_Telephone where Person_id = 1, 

Delete all Telephone where Id = Telephone_id from Person_has_Telephone <--- fail and got the above error..

* Telephone Table is the Parent table, isn't it?

What is wrong with it? How can I fix this?

Thanks


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>