SQLite 设置Datetime为默认时间

DATETIMEDEFAULT(datetime(CURRENT_TIMESTAMP,'localtime')),

范例SQL语句为:

CREATETABLE[TBL_TANK_ALARM](

[ALARM_ID]NUMBER(10),

[TANK_NO]VARCHAR2(50)NOTNULLCONSTRAINT[ALARM_TANKNO]REFERENCES[TBL_TANK]([TANK_NO])MATCHSIMPLE,

[ALARM]VARCHAR2(255),

[UPLOAD_TIME]DATETIMEDEFAULT(datetime(CURRENT_TIMESTAMP,'localtime')),

[IS_PROCESS]CHAR(1)DEFAULT('0'),

[PROCESS_USER]VARCHAR2(20),

[PROCESS_TIME]DATE,

[PROCESS_REMARK]VARCHAR2(255),

[ALARM_LEVEL]VARCHAR2(20),

[ALARM_VALUE]NUMBER(10,4));

譬如:
create table client (_id integer primary key autoincrement," +"客户名称   varchar(100) NOT NULL, 联系人  varchar(100)," +"联系电话   varchar(100), 邮箱   varchar(100), 地址   varchar(200),"+"传真    varchar(100), QQ  varchar(100), 所在省份   varchar(200),"+"客户状态    varchar(100), 客户级别  varchar(100), 备注   varchar(1000),"+"录入时间   TIMESTAMP default (datetime('now', 'localtime')));"

相关推荐