is there a form of qu开发者_开发技巧ery which i can delete an entry from an sqlite database by just its file name without knowing the exact column it resides on.
i know this code could work, but i don't know what to put for my Where clause. i tried this but i don't know if am correct. Thank you.
public boolean deleteTag(String entry ){
return db.delete(DATABASE_TABLE, KEY_ID + "=?", new String[]{entry}) >0;
}
or is there anyway, i can retrieve the column name from querying a cursor.sorry i know what am asking sounds strange. Thank you
'Cursor.getColumnNames()will give you array of names. Then you can loop through it and get column id by doing
Cursor.getColumnIndex(columnName)` is that what you are asking?
精彩评论