I am trying to clear a table that has autoincrement key.
I am trying to do the following, by i get an exception.
protected void clearSqliteSequenceTable
Just modify your query
from
String query = "delete from sqlite_sequence where name = business";
to
String query = "delete from sqlite_sequence where name = \'business\' ";
I have tried its working fine :-)
Your "where" statement of
name = business
tries to delete from the table sqlite_sequence
where the name
column equals a hypotheticalbusiness
column. If you are trying to delete from sqlite_sequence
where the name column contains the value "business", try
String query = "DELETE FROM sqlite_sequence WHERE name = 'business'";
try this
protected void clearSqliteSequenceTable(String table) {
String query = "delete from " + table;
mDb.execSQL(query);
}