Sunday, 8 September 2013

FATAl Exception during delete record from sqlite in Android?

FATAl Exception during delete record from sqlite in Android?

In my database Inbox table have column name path to keep path of files but
when i am trying to delete that record on the base of path the FATAL
exception is thrown by Emulator.
// Deleting single File
public void deleteFile(File file) {
SQLiteDatabase db = this.getWritableDatabase();
db.delete(TABLE_INBOX, KEY_PATH + " = "+file.getPath(),null);
db.close();
}
Exception is :
FATAL EXCEPTION:main
android.database.sqlite.SQLiteExceprion: unrecognized token:"1kbFile"(code
1):,while compiling :DELETE inbox WHERE path=1kbFile.txt.
1kbFile.txt is path that i want to delete which is already saved in db.
how can i solve this?

No comments:

Post a Comment