android - differentiate between update and inset in SQLite -
in sqlite how can if row exists update else createentry? want have table single row , update whenever single button pressed or so.
entry.open(); if(the row exist) entry.updatecontact(1, double.tostring(db1), double.tostring(db2), double.tostring(db3)); else entry.createentry(double.tostring(db1), double.tostring(db2), double.tostring(db3)); entry.close();
sounds want insert or replace
. there's blog post on topic @ http://www.buzzingandroid.com/2013/01/sqlite-insert-or-replace-through-contentprovider/
Comments
Post a Comment