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
Post a Comment