Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.database.sqlite.SQLiteException: near "Group": syntax error (code 1):

Tags:

android

sqlite

Error

Caused by: android.database.sqlite.SQLiteException: near "Group": syntax error (code 1): , while compiling: create table Group(_id integer primary key autoincrement, GroupName TEXT , MemberName TEXT , TotalExpense TEXT );

Code:-

public static final String CREATE_GROUP_TABLE = "create table " + ROOM_GROUP_TABLE +
            "(" + GROUP_ID + " integer primary key autoincrement, "
            + ROOM_COLUMN_GROUP_NAME + " TEXT , "
            + ROOM_COLUMN_MEMBER_NAME + " TEXT , "
            + ROOM_COLUMN_TOTAL_EXPENSE + " TEXT );";
like image 244
Parth Patel Avatar asked Mar 31 '26 04:03

Parth Patel


1 Answers

Your table name can't be Group, Group is a keyword.

List of sqlite keywords: https://www.sqlite.org/lang_keywords.html

like image 133
isma3l Avatar answered Apr 02 '26 20:04

isma3l



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!