2012-07-10 100 views
-1

在我的应用程序中,我创建了一个数据库(之前与组字段它工作正常)。现在我想cretae多一个字段(称为组)。我创建该字段。但显示以下错误:在数据库中的语法错误

android.database.sqlite.SQLiteException: near "group": syntax error: create table incomexpense(_id integer primary key autoincrement,price text not null,description text not null,quantity text not null,total text not null,category text not null,recurrence text not null,date text not null,group text not null); 

我创建命令:

"create table incomexpense(_id integer primary key autoincrement,"+"price text not null,description text not null,"+"quantity text not null,"+"total text not null,"+"category text not null,"+"recurrence text not null,"+"date text not null,"+"group text not null);"; 

回答

4

group是一个关键字,那么在创建表它不应该被使用。

+0

非常感谢..它工作正常..我有点新的android和这个数据库的概念... – Prakash 2012-07-10 05:18:36

+1

@Prakash,你应该接受这个答案(点击旁边的复选标记)。这将让每个人都知道你的问题已经解决,并给予帮助你的人一些认可。 – Barak 2012-07-10 06:07:18

相关问题