On 7/28/06, Gerry Snyder <[EMAIL PROTECTED]> wrote:
Finally, get it right:
sqlite> create table test(f integer primary key autoincrement, v int
default 0);
sqlite> insert into test (v) values (1);
sqlite> insert into test (v) values (2);
sqlite> insert into test (v) values (NULL);
sqlite> select * from test;
1|1
2|2
3|

Not sure why the last row is not 3|0.

Because NULL is allowed for field in question.
You can insert default value like this:
 insert into test (f) values (NULL);

Inserting NULL into autoincrement field just increments it. While
omitting value for any other field uses default for that field, if one
is defined.

--
Nemanja Corlija <[EMAIL PROTECTED]>

Reply via email to