Become a leader in the IoT community!
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Hi everyone,
I’m working on an IoT project that involves storing data in a database. While writing the SQL code, I encountered the following error:
“violated – parent key not found”
I search everywhere, Has anyone else encountered this issue, or can anyone provide guidance on how to fix
Check if the colums/fields in your query maych that of the table in database. What is the database vendor? Can you run the same query manually using native db client? Are you doing a select, update, or insert?
i am using MySQL, I am entering a values linked to a foreign key (FK)..
Sounds like a db issue with the query. I would approach this by trying with the mysql native client to see if it works there. There is a post on Stack Overflow that describes similar issue: https://stackoverflow.com/questions/69042788/im-repeatedly-getting-this-integrity-constraint-violated-parent-key-not-found
Thank you @jjo548 , actually i found that one of the FOREIGN KEY values in the REFERENCE Table does not exist in the Parent Table. I just Ensure that the ID value matches in both tables. β
CONTRIBUTE TO THIS THREAD