Gerry Snyder uttered:

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 you've explicitly inserted a NULL. The default value is only used if the column is not explicitly specified in the insert.



HTH,

Gerry


--
    /"\
    \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
     X                           - AGAINST MS ATTACHMENTS
    / \

Reply via email to