Brandon
Brandon

Reputation: 703

Sqlite Syntax Error

I get this error:

06-30 12:26:28.987: ERROR/AndroidRuntime(14818): Caused by: android.database.sqlite.SQLiteException: near "when": syntax error: CREATE TABLE hTable (id INTEGER PRIMARY KEY, who TEXT, message TEXT, when TEXT)

Really confused to be host. Sat staring at it for about 15 minutes.

Upvotes: 1

Views: 233

Answers (1)

George Johnston
George Johnston

Reputation: 32258

WHEN is a reserved keyword. You'll need to change the column name or escape it.

See: http://www.sqlite.org/lang_keywords.html

Upvotes: 4

Related Questions