I am using sqlite database to store data. I have three tables: Invoice, InvRow, Invdetails.
Relationsip between the tables are:
Invoice.Id = InvRow.InvId
InvRow.Id = Invdetails.RowId
I need to delete related entries from three tables using a single query. How can I do that? Any help?
SQLite prior to version 3.6.19 (2009 Oct 14) does not support foreign key constraints, but you can use triggers to maintain relational integrity.
Starting with 3.6.19, however, SQLite supports proper foreign key constraints with ON [UPDATE|DELETE] CASCADE
clauses, that will do what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With