在 SQLite 中添加记录时遇到问题。
这是错误:
09-18 17:47:47.586: E/AndroidRuntime(1039):
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.capstone.pinoygoodies/com.capstone.pinoygoodies.GroceryView}:
android.database.sqlite.SQLiteException: near " ":
syntax error:
CREATE TABLE tblItem
(_id INTEGER PRIMARY KEY AUTOINCREMENT,
grocery_item TEXT NOT NULL,
grocery_qty TEXT NOT NULL
我的创建表
db.execSQL("CREATE TABLE " + DATABASE_TABLE + "(" +
KEY_ITEMID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
KEY_ITEM + " TEXT NOT NULL, " +
KEY_QTY + " TEXT NOT NULL ");
每当我点击添加按钮时,都会触发此错误。