3

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 );";

1 Answer 1

9

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

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.