0

Im having an issue creating 2 tables, This first get created no problem, but the second(TABLE_BELLS), is not being created.

Logcat keeps saying No Such Table

Why does the first table get created but the second doesn't??

Your help would be much appreciated.

@Override
public void onCreate(SQLiteDatabase db) {

    db.execSQL("CREATE TABLE " + TABLE_USERINFO + " (" + USER_INFO_COLUMN_ID + " integer primary key autoincrement, "
           + USER_INFO_COLUMN_APP_NAME + " text, " + USER_INFO_COLUMN_DEVICE_NUMBER + " text );");

    db.execSQL("CREATE TABLE " + TABLE_BELLS + " (" + BELLS_COLUMN_ID + " integer primary key autoincrement, "
            + BELLS_COLUMN_FROM + " text, " + BELLS_COLUMN_MESSAGE + " text, " + BELLS_COLUMN_DATE_TIME + " text );");



}
  • @laalto, i never understood too much of the answer on "When is SQLiteOpenHelper onCreate() / onUpgrade() run?" could you possibly simplify your answer? – Blacksamson79 Apr 28 '15 at 13:39

1 Answers1

0

I think after executing the first time the table created successfully.after that you modified the fields name or added some fields and complied again.in this case you are getting issue so, that you need to change the Database version number.

Sandeep Kumar
  • 350
  • 4
  • 18