Skip to content Skip to sidebar Skip to footer

Android Sqlite Database Column Defined In Create Table Script But Not Creating On Table

I have a the below table script: 'CREATE TABLE ' + TABLE_XXX + '(' + XXX_ID + ' INTEGER PRIMARY KEY,' + XXX_ITEM_NO + 'TEXT,'

Solution 1:

You need give some spaces on the code. Before the quotation marks.

"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 "   
+ ")";  

Solution 2:

There are missing whitespaces in your statement.

+ XXX_IS_OK +"INTEGER, "

should be:

+ XXX_IS_OK +" INTEGER, "

Post a Comment for "Android Sqlite Database Column Defined In Create Table Script But Not Creating On Table"