Re: [sqlite] Shouldn't have to specify primary key explicitly

2018-06-28 Thread Simon Slavin
On 28 Jun 2018, at 12:48pm, Scott Robertson wrote: > CREATE TABLE test2 ( > id INTEGER PRIMARY KEY, > book text, > page INTEGER > ); > > INSERT INTO test2 VALUES ('Lord of the Rings', 327); > > Error: table test2 has 3 columns but 2 values were supplied > > INSERT INTO test2 VALUES (9, 'Lord

Re: [sqlite] Shouldn't have to specify primary key explicitly

2018-06-28 Thread curmudgeon
>INTEGER PRIMARY KEY doesn’t default to autoincrement. It’s used in place of the automatically created >autoincrement rowid but you have to supply the values (I.e. they’re not created automatically). I stand corrected. If you supply null for the integer primary key it will assign the highest

Re: [sqlite] Shouldn't have to specify primary key explicitly

2018-06-28 Thread x
INTEGER PRIMARY KEY doesn’t default to autoincrement. It’s used in place of the automatically created autoincrement rowid but you have to supply the values (I.e. they’re not created automatically). On 28 Jun 2018, at 12:48, Scott Robertson wrote: > SQLite is supposed to autoincrement by

Re: [sqlite] Shouldn't have to specify primary key explicitly

2018-06-28 Thread Tim Streater
On 28 Jun 2018, at 12:48, Scott Robertson wrote: > SQLite is supposed to autoincrement by default when a column is defined > as "INTEGER PRIMARY KEY" according to everything I've read. But I've > only gotten this to work if I let SQLite create its own PK column. If I > have an explicit PK