mercredi 26 août 2015

Error in SQLite using empty insert statement

Given table and queries (SQLite):

CREATE TABLE project (id INTEGER PRIMARY KEY, name INTEGER DEFAULT 3)
Query 1: INSERT INTO project () VALUES ()
Query 2: INSERT INTO project (name) VALUES (1)
Query 3: INSERT INTO project (id) VALUES (5)

Executing the first query causes an error (SQLSTATE[HY000]: General error: 1 near ")": syntax error in php), while the other two execute just fine - see http://ift.tt/1fGBOya. Why does this error occur and why does it work fine for MySQL (http://ift.tt/1EkGgyG)?

Aucun commentaire:

Enregistrer un commentaire