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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -