sqlite db update

后端 未结 8 1672
暗喜
暗喜 2020-12-11 09:14

Is there an easy way to update a table in sqlite in android? (like a single line in built method) ? I have a table with few columns and primary is one column. I want to sear

相关标签:
8条回答
  • 2020-12-11 09:36

    The answer is:

    http://www.sqlite.org/lang_update.html

    and

    SQLiteDatabase.rawQuery(...)

    0 讨论(0)
  • 2020-12-11 09:41

    Using database.update make it simple like this:

    ContentValues values = new ContentValues();
        values.put(MySQLiteHelper.COLUMN_NAME, name);
        values.put(MySQLiteHelper.COLUMN_JOB, job);
        values.put(MySQLiteHelper.COLUMN_DATE_START, date_start);
        database.update(MySQLiteHelper.TABLE_EMPLOYEES, values, MySQLiteHelper.COLUMN_ID+"="+id, null);
    
    0 讨论(0)
提交回复
热议问题