android.database.sqlite.SQLiteException:“组"附近:语法错误(代码 1): [英] android.database.sqlite.SQLiteException: near "Group": syntax error (code 1):

查看:39
本文介绍了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 );";

推荐答案

你的表名不能是Group,Group是关键字.

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

sqlite 关键字列表:https://www.sqlite.org/lang_keywords.html

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

这篇关于android.database.sqlite.SQLiteException:“组"附近:语法错误(代码 1):的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆