Hi there,
I would like to confirm the transaction flow for three SQL statements (2
INSERT's + 1 UPDATE):
sqlite3_open_v2() - open database
sqlite3_prepare_v2() - prepare a statement
sqlite3_step() - BEGIN TRANSACTION
if an error occured sqlite3_finalize()
sqlite3_reset() - reset prepared statement
sqlite3_step() - INSERT
if an error occured previously for INSERT
(skip the UPDATE)
else
sqlite3_reset() - reset prepared statement
sqlite3_step() - UPDATE
end
if an error occured previously for either INSERT or UPDATE
(skip the INSERT)
else
sqlite3_reset() - reset prepared statement
sqlite3_step() - INSERT
end
sqlite3_reset() - reset prepared statement
if an error occured previously for either INSERT or UPDATE OR INSERT
sqlite3_step() - ROLLBACK TRANSACTION
else
sqlite3_step() - COMMIT TRANSACTION
end
sqlite3_finalize() - open database
sqlite3_close() - close database
Is this the correct flow?
Thank you very much.
Regards,
David
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users