我决定为我的应用添加第二个表。即使它与第一个表创建字符串几乎完全相同的设置,我也会不断收到语法错误。
private static final String BUDGET_TABLE = "budgets";
private static final String KEY_ROW_ID_BUDGET = "_id";
private static final String KEY_BUDGET_LIMIT = "limit";
private static final String KEY_BUDGET_CURRENT_AMOUNT = "current_amount";
此字符串在“限制”附近引发语法错误
private static final String BUDGET_CREATE =
"create table "+ BUDGET_TABLE +" ( "+ KEY_ROW_ID_BUDGET+" integer primary key autoincrement, "
+ KEY_BUDGET_LIMIT+" text not null, "+ KEY_BUDGET_CURRENT_AMOUNT+" text);";
db.execSQL(BUDGET_CREATE);