On 5 Apr 2012, at 1:36am, Pete <p...@mollysrevenge.com> wrote:

> Here's my test:
> 
> CREATE TABLE t2 (Col1 text,Col2 text);
> insert into t2 (Col1) values('xxx');
> select * from t2
> xxx|
> 
> CREATE TABLE t3 (Col1 text,Col2 text default 'abc');
> insert into t3 SELECT * FROM t2;
> select * from t3;
> xxx|
> 
> Why does t3.Col2 not have it's default value of 'abc'?

Because you fed it a value for the second column: NULL.  If you want the second 
column to have a default value you might find that

insert into t3 SELECT Col1 FROM t2;

works.

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

Reply via email to