sql - Insert or Update Table SQLite -


my table looks

table (id, attribute, value, expires, static) 

i'd able update table new values of value, expires or static when entry id/attribute pair exists. create new entry every new id/attribute pair , every new id.

i new @ using sqlite , have seen few posts similar problem sqlite - upsert *not* insert or replace not address i'm trying do. maybe approach , need different table format.

please let me know thoughts/suggestions.

just put logic program:

bool ok = query.exec("update ..."); ... if (query.numrowsaffected() == 0) {     ok = query.exec("insert ...");     ... } 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -