Re: [sqlite] Db design question (so. like a tree)

2009-06-05 Thread Francis GAYREL
) is recommended. (for example Link types may be Father,Mother,Clone) John Machin a écrit : > On 5/06/2009 5:27 PM, Francis GAYREL wrote: > >> To build a consistent oriented tree we need to associate to the nodes a >> ranking property such as the birthdate (or any pr

Re: [sqlite] Db design question (so. like a tree)

2009-06-05 Thread Francis GAYREL
To build a consistent oriented tree we need to associate to the nodes a ranking property such as the birthdate (or any precedence criterion). Therefore the ancestor of someone is to be selected among older ones. To make the ancestor allocation more easy the ancestor's list may be filtered on

Re: [sqlite] How to use PRIMARY KEY AUTOINCREMENTwhenmodellingweakentities?

2008-09-06 Thread Francis GAYREL
Can I suggest another way that I adopted a long time ago to solve this kind of issue? Forget the autoincrement function included in your RDBM and use a customized one more or less similar to the one I developped in my ZQLib (adapted from ZEOSDBO) for Delphi (previously I did the same thing

Re: [sqlite] Any equivalent to MSSQL's UPDATE..FROM.. clause ?

2008-08-22 Thread Francis GAYREL
I met the same issue. REPLACE is the right way to override it. Assuming C1 is the primary key or at least unique, instead of UPDATE T1 INNER JOIN T2 ON T1.C1=T2.C1 SET T1.C2=T2.C2 WHERE T1.C2<>T2.C2; you can write: REPLACE INTO T1 SELECT T1.C1,T2.C2,C3,C4 FROM T1 INNER JOIN T2 ON T1.C1=T2.C1

Re: [sqlite] How to use the ROWID of the last inserted row for FK insert into other tables?

2008-08-21 Thread Francis GAYREL
Why two tables? Define a unique table and redefine your tables as views. alp a écrit : > Hello, > > I have to tables(TBL_OBJECTS, TBL_TAGS) and I want to use the ROWID of the > last inserted row from table TBL_OBJECTS to insert a new row in TBL_TAGS > table with the ID_OBJECT foreign key set to