开发者

Delete row from an sqlite database through file name and without knowing specific column

开发者 https://www.devze.com 2023-03-02 22:13 出处:网络
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.

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 doingCursor.getColumnIndex(columnName)` is that what you are asking?

0

精彩评论

暂无评论...
验证码 换一张
取 消