Javier Julio <[EMAIL PROTECTED]> wrote: > Is it possible in SQLite to have a single statement that basically > says if this row exists run an UPDATE statement, if not run an INSERT?
In some situations, depending on your definition of "exists", INSERT OR REPLACE statement may be suitable: http://sqlite.org/lang_insert.html http://sqlite.org/lang_conflict.html Otherwise you will have to emulate it in your program code. Perform an UPDATE, use sqlite3_changes to see if any rows were actually modified as a result, if not run INSERT. > I believe these are done in procedures which I know is not supported > in SQLite. But I'm pretty sure the language you write your host application in supports some concept of a subroutine. Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users