Re: [sqlite] setting autoincrement value on table with two primary keys

2010-12-05 Thread Christophe Danker
Hi, * Kees Nuyt [2010-12-05 22:09:08 +0100]: > If you need a compound index for performance reasons, you can use > the autoincrement key as the primary key for the table and define a > unique index on the compound key. Is doesn't serve as a constraint > though, because the primary key constraint

Re: [sqlite] setting autoincrement value on table with two primary keys

2010-12-05 Thread Christophe Danker
Hello Igor, * Igor Tandetnik [2010-12-05 11:53:17 -0500]: > If you want ID to be auto-incremented, then it will always be unique on its > own. Why then do you want a compound primary key? Just declare > > ID integer primary key thanks for answering. Well, without wanting to open up a general

[sqlite] setting autoincrement value on table with two primary keys

2010-12-05 Thread Christophe Danker
Hi all, I did look at archives and found one way to do this: bash:~$ sqlite3 test.db SQLite version 3.2.8 Enter ".help" for instructions sqlite> create table test("ID" INTEGER NOT NULL, "a" VARCHAR(100), "b" VARCHAR(100), PRIMARY KEY("ID","b")); sqlite> insert into test ("a","b") VALUES ('foo',