Re: [sqlite] ensuring uniqueness of tuples spanning across multipletables?

2011-10-07 Thread Jim Morris
On 10/6/2011 10:43 PM, Ivan Shmakov wrote: Jim Morris writes: > The recent thread may relate: "[sqlite] Is there an efficient way to > insert unique rows (UNIQUE(a, b, c)) into an fts3 virtual table?" > INSERT INTO fts3_table (a,b,c) > SELECT 'an A','a B','a C' > WHERE NOT

Re: [sqlite] ensuring uniqueness of tuples spanning across multipletables?

2011-10-06 Thread Ivan Shmakov
> Jim Morris writes: > The recent thread may relate: "[sqlite] Is there an efficient way to > insert unique rows (UNIQUE(a, b, c)) into an fts3 virtual table?" > INSERT INTO fts3_table (a,b,c) > SELECT 'an A','a B','a C' > WHERE NOT EXISTS > (SELECT DISTINCT a,b,c > FROM fts3_table >

Re: [sqlite] ensuring uniqueness of tuples spanning across multipletables?

2011-10-05 Thread Jim Morris
The recent thread may relate: "[sqlite] Is there an efficient way to insert unique rows (UNIQUE(a, b, c)) into an fts3 virtual table?" INSERT INTO fts3_table (a,b,c) SELECT 'an A','a B','a C' WHERE NOT EXISTS (SELECT DISTINCT a,b,c FROM fts3_table WHERE a='an A' AND b='a B' AND c='a C'); The

Re: [sqlite] ensuring uniqueness of tuples spanning across multipletables?

2011-10-04 Thread Ivan Shmakov
> Igor Tandetnik writes: > Ivan Shmakov wrote: >> This structure is, obviously, could just as well be represented >> with, e. g.: >> CREATE TABLE "foo" ( >> "key" INTEGER PRIMARY KEY, >> "value" INTEGER NOT NULL, >>

Re: [sqlite] ensuring uniqueness of tuples spanning across multipletables?

2011-10-04 Thread Igor Tandetnik
Ivan Shmakov wrote: > Well, this case is somewhat weird. I have a number of tables > like: > > PRAGMA "foreign_keys" = 1; > > CREATE TABLE "foo-L" ( >key INTEGER PRIMARY KEY >REFERENCES "foo" (key), >value INTEGER NOT NULL); > > Which are tied