在我的应用程序中,我创建了一个数据库,并尝试将值插入到该表中。但我收到以下错误:
android.database.sqlite.SQLiteException: table income has no column named recurrence: , while compiling: INSERT INTO income(recurrence, salary, description) VALUES(?, ?, ?);
我的代码是:
数据库创建:
"create table income(_id integer primary key autoincrement,"+"salary text not null,description text not null,"+"recurrence text not null);";
我的插入查询:
public long insertTitle(String income, String desc,String recurr)
{
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_INCOME, income);
initialValues.put(KEY_DESC, desc);
initialValues.put(KEY_RECURR, recurr);
//initialValues.put(KEY_PUBLISHER, publisher);
return db.insert(DATABASE_TABLE, null, initialValues);
}