James Peters
James Peters

Reputation: 147

Create Table SQLite 3 Error

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

Answers (1)

CL.
CL.

Reputation: 180070

The documentation shows that the expression for the default value must be enclosed in parentheses:

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

Upvotes: 1

Related Questions