我有一个下表脚本:
"CREATE TABLE " + TABLE_XXX + "("
+ XXX_ID + " INTEGER PRIMARY KEY,"
+ XXX_ITEM_NO + "TEXT,"
+ XXX_DETAILS +"TEXT,"
+ XXX_EXP_DATE + "TEXT,"
+ XXX_IS_OK +"INTEGER, "
+ XXX_CODE + "TEXT"
+ ")";
但是当我要插入数据以获取错误时, TABLE_XXX没有名为XXX_IS_OK的列。
如何克服它。
谢谢!
答案 0 :(得分:1)
您的陈述中缺少空格。
+ XXX_IS_OK +"INTEGER, "
应该是:
+ XXX_IS_OK +" INTEGER, "
答案 1 :(得分:1)
您需要在代码上添加一些空格。在引号之前。
"CREATE TABLE " + TABLE_XXX + "("
+ XXX_ID + " INTEGER PRIMARY KEY, "
+ XXX_ITEM_NO + " TEXT, "
+ XXX_DETAILS +" TEXT, "
+ XXX_EXP_DATE + " TEXT, "
+ XXX_IS_OK + " INTEGER, "
+ XXX_CODE + " TEXT "
+ ")";