在sqlite表定义中将文本强制转换为数字

在sqlite表定义中将文本强制转换为数字,sqlite,casting,create-table,Sqlite,Casting,Create Table,sqlite中是否有强制转换,我需要它在创建表定义中工作 .... mydatetime numeric not null DEFAULT (strftime('%Y%m%d%H%M','now', 'localtime')) ); 谢谢 sqlite> .headers on sqlite> CREATE TABLE t1 (mydatetime int not null DEFAULT (strftime('%Y%m%d%H%M', 'now', 'localtime')),

sqlite中是否有强制转换,我需要它在创建表定义中工作

....
mydatetime numeric not null DEFAULT (strftime('%Y%m%d%H%M','now', 'localtime')) );
谢谢

sqlite> .headers on
sqlite> CREATE TABLE t1 (mydatetime int not null DEFAULT (strftime('%Y%m%d%H%M',
'now', 'localtime')), otherval TEXT);
sqlite>
sqlite> INSERT INTO t1 (otherval) VALUES ('qwe');
sqlite> SELECT * FROM t1;
mydatetime|otherval
201201231947|qwe