android.database.sqlite.SQLiteException: near "FOREIGN": syntax error (code 1): , while compiling: CREATE TABLE Messages( FOREIGN KEY(RoomID) REFERENCES ChatRooms(RoomID), Message TEXT, Side BOOLEAN, Type TEXT )

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by revipod
, 2 years ago
near "FOREIGN": syntax error (code 1): , while compiling: CREATE TABLE Messages( FOREIGN KEY(RoomID) REFERENCES ChatRooms(RoomID), Message TEXT, Side BOOLEAN, Type TEXT )
via Stack Overflow by Manuel
, 1 year ago
near "where": syntax error (code 1): , while compiling: CREATE TABLE studentDetails(id INTEGER PRIMARY KEY,what TEXT,description TEXT,color TEXT,where TEXT,who TEXT)
via Stack Overflow by Nitin
, 2 years ago
near "table": syntax error (code 1): , while compiling: CREATE TABLE table(_id INTEGER PRIMARY KEY Autoincrement,date INTEGER,quantity TEXT,materialTEXT ;)
via Stack Overflow by user2656455
, 2 years ago
near "tableLOGINDETAILS": syntax error (code 1): , while compiling: create tableLOGINDETAILS( ID integer primary key autoincrement, USERNAME text , PASSWORD text , EMPLOYEE_CODE text , MOBILE integer );
via Stack Overflow by Shirish Herwade
, 2 years ago
near "<": syntax error (code 1): , while compiling: DELETE FROM engine_utilization_report WHERE unix_time <
via GitHub by ursusursus
, 1 year ago
near "=": syntax error (code 1): , while compiling: DELETE FROM `Article` WHERE `mId` NOT IN (SELECT `A`.`mId` FROM `Article` AS `A` INNER JOIN `Message` AS `M` ON `M`.`mArticleId_mId`=`A`.`mId` ,`mWatched`=0)
android.database.sqlite.SQLiteException: near "FOREIGN": syntax error (code 1): , while compiling: CREATE TABLE Messages( FOREIGN KEY(RoomID) REFERENCES ChatRooms(RoomID), Message TEXT, Side BOOLEAN, Type TEXT )
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)

Users with the same issue

12 times, 3 days ago
40 times, 2 months ago
347 times, 2 months ago
9 times, 3 months ago
Once, 5 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.