I’m testing this statement in Safari 5.0.5, but I get an error before FOREIGN:
CREATE TABLE IF NOT EXISTS Idea (
id INTEGER PRIMARY KEY,
title TEXT NOT NULL,
content TEXT NOT NULL,
created TIMESTAMP NOT NULL,
sketchID INTEGER,
categoryID INTEGER NOT NULL,
FOREIGN KEY (sketchID) REFERENCES (Sketch),
FOREIGN KEY (categoryID) REFERENCES (Category));
I get the following error message:
SQLStatementError 1 [DATABASE] near "(": syntax error
Where is the error in this SQL statement?
(Adding my comment as an answer)
As Neil pointed out, you are closing the bracket at the wrong position.
Additionally the syntax for the foreign key is wrong, the following should work (provided the HTML5 SQL dialect is standard compliant)