108
Views
4
Comments
Solved
FOREIGN KEY SAME TABLE constraint ?
Question

Here's an interesting error that seemed to pop up unannounced...

The UPDATE statement conflicted with the FOREIGN KEY SAME TABLE constraint.

Anyone know what the cause of this is?

Dan

UserImage.jpg
Daniel McMechan
Solution

Turns out it was an error in our code. Sorry for any inconvenience.

2020-01-09 12-38-06
Vijay Selvaraj

Can you please provide the details of the Entity (Table) you were trying to update and what were you doing when the issue happens?

2018-06-05 16-54-03
Maria da Graça Peixoto

Have you a field which type is that same table identifier?

2024-11-07 03-28-42
Stuart Harris
Champion

Hi Daniel,

The FOREIGN KEY SAME TABLE error can occur when you have a table that has an attribute which is a foreign key that refers to itself.

The error will occur if the attribute has a value that is not present in the table as a primary key.

Does that scenario match with your data model?

Kind regards,

Stuart

UserImage.jpg
Daniel McMechan
Solution

Turns out it was an error in our code. Sorry for any inconvenience.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.