Re: [sqlite] many-one relation

2007-10-08 Thread John Stanton
for the confusing message earlier -x- Chetana - Original Message From: Trevor Talbot <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, October 8, 2007 9:10:22 PM Subject: Re: [sqlite] many-one relation On 10/8/07, chetana bhargav <[EMAIL PROTECTED]> wrote: We go

Re: [sqlite] many-one relation

2007-10-08 Thread Trevor Talbot
I wrote: > On 10/8/07, chetana bhargav <[EMAIL PROTECTED]> wrote: > > >> Is this a garbage collection situation, where you want a row in B to go > > >> away when all referring rows in A are deleted? > > > > Yes exactly this is what I wanted :) > Maintaining a reference count in table B may be

Re: [sqlite] many-one relation

2007-10-08 Thread Trevor Talbot
On 10/8/07, chetana bhargav <[EMAIL PROTECTED]> wrote: > >> Is this a garbage collection situation, where you want a row in B to go > >> away when all referring rows in A are deleted? > > Yes exactly this is what I wanted :) Okay. A trigger on table A can accomplish it without any extra

Re: [sqlite] many-one relation

2007-10-08 Thread Kees Nuyt
On Mon, 8 Oct 2007 09:04:53 -0700 (PDT), you wrote: >>> Is this a garbage collection situation, where >>> you want a row in B to go away when all >>> referring rows in A are deleted? > >Yes exactly this is what I wanted :) > >Sorry for the confusing message earlier > >-x- >Chetana This might

Re: [sqlite] many-one relation

2007-10-08 Thread chetana bhargav
EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, October 8, 2007 9:10:22 PM Subject: Re: [sqlite] many-one relation On 10/8/07, chetana bhargav <[EMAIL PROTECTED]> wrote: > We got two tables, tableA & tableB. > > tableB is turning out to be a many-one relation where in w

Re: [sqlite] many-one relation

2007-10-08 Thread Trevor Talbot
On 10/8/07, chetana bhargav <[EMAIL PROTECTED]> wrote: > We got two tables, tableA & tableB. > > tableB is turning out to be a many-one relation where in we have many rows of > tableA mapping to one row of tableB, would like to know what is the best way > to delete a row in tableB > > 1. Keep a