2015-07-11 149 views
1

錯誤android.database.sqlite.SQLiteException:近 「組」:語法錯誤(代碼1):

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

代碼: -

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

回答

3

你的表名可以」 t是Group,Group是關鍵字。

sqlite的關鍵字列表:https://www.sqlite.org/lang_keywords.html

+0

謝謝@ isma3l –

+0

@ParthPatel歡迎你,請接受的答案,閱讀http://meta.stackexchange.com/questions/5234/how-does-accepting-的回答工作 – isma3l

相關問題