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?
path='1kbFile.txt'+"'"+sKEY_PATH + " = '"+file.getPath() + "'"if it works I'll make it an official answer