Increment in Android SQLite -
i want update col_item_auto_id column +1 in each column
like this: replace 10 11, 11 12, etc!! me pls... here code is,
public void updatemiddletemp(int autoid) { sqlitedatabase db = this.getwritabledatabase(); int id=51; contentvalues cv_temp1 = new contentvalues(); cv_temp1.put(col_item_auto_id, col_item_auto_id+1); //ff long stemp = db.updatewithonconflict(table_kot_items_temp, cv_temp1, col_item_auto_id + " >= " + autoid, null,sqlitedatabase.conflict_ignore); db.close(); }
try code, works fine:
db.execsql("update " + table_kot_items_temp + " set " + col_sl_no + " = " + col_sl_no + " +1 " + col_sl_no + " >" +into); db.close();
Comments
Post a Comment