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

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -