On 2017/12/23 1:57 PM, skywind mailing lists wrote:
Hello,

I have checked the documentation but did not find an explicit answer concerning 
my case. Of course I can test it but this does not mean that the functionality 
is guaranteed also for future versions. Assume I have an insertion statement 
like

INSERT OR REPLACE INTO TestTable VALUES(1,2);

Furthermore, I have an INSERT, UPDATE and DELETE Trigger for the table. Which 
triggers are triggered in case of

a) insertion (pretty obvious, should always be the INSERT trigger)
b) replace (DELETE and INSERT trigger or UPDATE trigger or depends on... .)

INSERT OR REPLACE amounts to either just "INSERT" or "DELETE, then INSERT" based on whether or not the Constraint/Key is violated, so you are guaranteed to have the INSERT trigger fire, but if the item did exist before, the DELETE trigger will fire first.

HTH,
Ryan

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to