I'm trying to use default values and autoincrementing primary keys.

[EMAIL PROTECTED]:~$ sqlite3 /data/mariof/test.db_scia.db
SQLite version 3.3.4
Enter ".help" for instructions
sqlite> create table test(f int auto_increment primary key, v int default 0);
sqlite> insert into test (v) values (1);
sqlite> insert into test (v) values (2);
sqlite> insert into test (v) values (1);
sqlite> insert into test (v) values (NULL);
sqlite> select * from test;
|1
|2
|1
|

I'm not a great fan of the auto_increment feature, I like sequences a
lot better, but as sqlite recognizes it, does it also implement it?  the
documentation states "the requested feature was added in 3.1", I'm
testing with 3.3.4...

and how do I insert a 'all-default' record?

sqlite> insert into test default values;
SQL error: near "default": syntax error
sqlite> insert into test () values ();
SQL error: near ")": syntax error

actually, missing auto_increment and sequences, inserting an 'all default'
record is just a style exercise, not really particularly useful...

thanks,
Mario Frasca

-- 
Die Welt wird nicht bedroht von den Menschen, die böse sind, sondern
von denen, die das Böse zulassen
  -- Albert Einstein

Reply via email to