On 09/08/07, Paul Harris <[EMAIL PROTECTED]> wrote: > Hi, > > Can someone please explain why adding the auto_increment term seems to > STOP the auto_increment behaviour? > > $ sqlite3 > SQLite version 3.3.17 > Enter ".help" for instructions > sqlite> .headers on > sqlite> create table abc (id integer auto_increment primary key, value text); > sqlite> insert into abc (value) values ('justvalue'); > sqlite> insert into abc (id,value) values (null,'withid'); > sqlite> select * from abc; > id|value > |justvalue > |withid > sqlite> create table def (id integer primary key, value text); > sqlite> insert into def (value) values ('justvalue'); > sqlite> insert into def (id,value) values (null,'withid'); > sqlite> select * from def; > id|value > 1|justvalue > 2|withid > sqlite> > > Note that abc (the one with auto_increment) does NOT fill in the id > primary key. Baffling to anyone except for me? > > thanks > Paul >
I dislike answering myself, but no sooner I had sent that email, I tried this: sqlite> create table ghi (id integer primary key autoincrement, value text); sqlite> insert into ghi (value) values ('justvalue'); sqlite> insert into ghi (id,value) values (null,'withid'); sqlite> select * from ghi; id|value 1|justvalue 2|withid sqlite> so, why doesn't auto_increment do either of the following more sensible things: 1) throw an error 2) do what "autoincrement" does ? thanks Paul ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------