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

2010-12-06 Thread Kees Nuyt
On Sun, 5 Dec 2010 19:08:59 -0500, "Igor Tandetnik" wrote: >Kees Nuyt wrote: >> 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. > > I can't think of any statement that wo

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

2010-12-05 Thread Igor Tandetnik
Kees Nuyt wrote: > 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. I can't think of any statement that would run faster if you, in addition to an existing unique index on A

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 Kees Nuyt
On Sun, 5 Dec 2010 20:53:43 +0100, Christophe Danker wrote: > thanks for answering. Well, without wanting to open up a general discussion > on the merits or not of having compound primary keys with one auto-increment > value, i had other technical constraints in mind relating to perl's > Catalyst

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

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

2010-12-05 Thread Igor Tandetnik
Christophe Danker wrote: > sqlite> create table test("ID" INTEGER NOT NULL, "a" VARCHAR(100), "b" > VARCHAR(100), PRIMARY KEY("ID","b")); > > Also: couldn't that bug be resolved for multi-column primary key situations > if only one column is of type "INTEGER" (vs "VARCHAR" or even "INT")? If yo

[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',

Re: [sqlite] Setting Autoincrement

2004-04-06 Thread Darren Duncan
At 11:01 PM -0700 4/5/04, Keith Herold wrote: I have an in-memory db that periodically writes to a disk db (there are good reasons for this). Later, I may need a connection to that disk db via another memory db, but any inserts from that connection need to take place at the appropriate autoincreme

Fw: [sqlite] Setting Autoincrement

2004-04-06 Thread Roy Black
lt;[EMAIL PROTECTED]> Sent: Monday, April 05, 2004 11:01 PM Subject: [sqlite] Setting Autoincrement Hi folks; is there a way to set an INTEGER PRIMARY KEY to a predetermined value, so that all subsequent inserts have the correct autoincrement value? I have an in-memory db that periodically writ

[sqlite] Setting Autoincrement

2004-04-05 Thread Keith Herold
Hi folks; is there a way to set an INTEGER PRIMARY KEY to a predetermined value, so that all subsequent inserts have the correct autoincrement value? I have an in-memory db that periodically writes to a disk db (there are good reasons for this). Later, I may need a connection to that disk db vi