samedi 24 janvier 2015

db.update does db.insert instead

Anyone got an idea why this code does an insert instead of an update? It doesnt fail, it just does an insert. Thus jacking up the db.



String[] cur_row = {String.valueOf(cursor.getPosition())};
values.put("colA", dataA);
values.put("colB", dataB);
values.put("colC", dataC);

db.beginTransaction();
try{
db.update("tbl2", values, "_id=?", cur_row);
db.setTransactionSuccessful();
}catch(Exception e){
System.out.println("FAIL: " + e);
}
finally{
db.endTransaction();
}


Many thanks


Aucun commentaire:

Enregistrer un commentaire