On 4/4/2012 8:48 PM, Pete wrote:
The test this time was:

sqlite>  create table t1 (Col1,Col2);
sqlite>  insert into t1 (Col1) values ('xxx');
sqlite>  select * from t1;
xxx|

sqlite>  create table t2 (Col1, col2 not null default 'abc');
sqlite>  insert into t2 SELECT * from t1;
SQL error: t2.col2 may not be NULL

Default clause applies when you omit a column from the list in INSERT (like you did when inserting into t1). It doesn't apply when you attempt to insert NULL explicitly.
--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to