Reputation: 147
Could some please explain why I am getting an error when creating this table below?
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')
);
The error I am getting is:
Error: near "(": syntax error
Upvotes: 0
Views: 34
Reputation: 180070
The documentation shows that the expression for the default value must be enclosed in parentheses:
LastUpdate DEFAULT (DATE('now', 'local')),
Upvotes: 1