I have the following:
public static final String COL_4 = "ID";
And:
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table " + TABLE_NAME + " (LastScore INTEGER, Highscore INTEGER, Title TEXT, ID BOOLEAN)");
This works perfectly;
However, if I change ID to, say, "John" (in the declaration and the execSQL),I get the following error:
android.database.sqlite.SQLiteException: no such column: John (code 1): , while compiling: UPDATE Player_Stats SET LastScore=?,Title=?,John=?,Highscore=?
Any idea how such a change in the name of the String throw an exception? Thank you!
EDIT: The problem is not with Boolean. The same problem happens if I change it to Integer. Works with "ID", doesn't with "John"
It seems when I first ran it, the Database was created with the ID column. Hence, I am only calling the onUpgrade() later rather than the onCreate(), which is expecting a column called ID rather than John. I am in the incapability to do this, but I believe deleting the database and starting over will solve the issue. Thanks for the support!