Re: [sqlite] DELETE OR IGNORE statement?

2010-09-24 Thread Andy Gibbs
On Friday, September 24, 2010 1:03 PM, Josh Gibbs wrote: > What's the chance that 2 people with the same surname would have > the same problem in the same week... > > [ ... ] I can only think its something in the name! I did actually see your thread moments after creating my own. I'd done a

Re: [sqlite] DELETE OR IGNORE statement?

2010-09-24 Thread Josh Gibbs
What's the chance that 2 people with the same surname would have the same problem in the same week... I believe I just solved the same problem you are asking about yesterday thanks to a query from Richard: CREATE TABLE Message (message_id INTEGER PRIMARY KEY AUTOINCREMENT, >>> Subject TEXT);

Re: [sqlite] DELETE OR IGNORE statement?

2010-09-23 Thread Simon Slavin
On 23 Sep 2010, at 2:59pm, Andy Gibbs wrote: > It seems to be a trade-off -- either the complexity is in the DELETE > statement to keep the primary key table tidy or in the SELECT statement > querying it. If it has to be a choice, then the complexity has to be in the > DELETE statement since

Re: [sqlite] DELETE OR IGNORE statement?

2010-09-23 Thread Andy Gibbs
On Thursday, September 23, 2010 3:36 PM, Simon Slavin wrote: > On 23 Sep 2010, at 2:13pm, Andy Gibbs wrote: > >> I've got a table with a primary key and then any number of additional >> tables >> with foreign keys that reference this primary key table with "ON DELETE >> RESTRICT" > > I always

Re: [sqlite] DELETE OR IGNORE statement?

2010-09-23 Thread Simon Slavin
On 23 Sep 2010, at 2:13pm, Andy Gibbs wrote: > I've got a table with a primary key and then any number of additional tables > with foreign keys that reference this primary key table with "ON DELETE > RESTRICT" I always worry when I see descriptions like this. Those additional tables: do

[sqlite] DELETE OR IGNORE statement?

2010-09-23 Thread Andy Gibbs
Hi, I've got a table with a primary key and then any number of additional tables with foreign keys that reference this primary key table with "ON DELETE RESTRICT" hence stopping the deletion of any row from the primary key table if there exists any rows in any of the foreign key tables that