3

The following code

@Override
    public void onUpgrade(SQLiteDatabase db, int i, int i1) {
        db.execSQL("DROP IF TABLE EXISTS " + TABLE_NAME);
        onCreate(db);
    }

always gives an error index table trigger or view got if

Why is that? I hope anyone can help me.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Yannick
  • 33
  • 1
  • 5

2 Answers2

8

Drop your Table by using following code

db.execSQL("DROP TABLE IF EXISTS " + YOUR_TABLE);
Subin Babu
  • 1,515
  • 2
  • 24
  • 50
0

Correct Syntax:

DROP TABLE IF EXISTS

Incorrect Syntax:

DROP IF TABLE EXISTS
kenlukas
  • 3,616
  • 9
  • 25
  • 36