2017-05-26 82 views
0

請解釋一下爲什麼我在創建下面的表時遇到錯誤?創建表SQLite 3錯誤

CREATE TABLE Login 
    (
     Username TEXT PRIMARY KEY NOT NULL, 
     Password NOT NULL, 
     LastUpdate DEFAULT DATE('now', 'local'), 
     Status TEXT, 
     CustomerID INTERGER, 
     CHECK (Status='active' or Status='inactive') 
    ); 

我得到的錯誤是:

Error: near "(": syntax error

回答

1

documentation顯示,默認值表達式必須用括號括起來:

LastUpdate DEFAULT (DATE('now', 'local')),