0

我有一个下表脚本:

"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 的列

如何克服它。谢谢!

4

2 回答 2

1

您的陈述中缺少空格。

+ XXX_IS_OK +"INTEGER, "

应该:

+ XXX_IS_OK +" INTEGER, "
于 2013-09-10T11:52:42.843 回答
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 "   
+ ")";  
于 2013-09-10T11:53:32.357 回答