The documentation states that in cases of replacement the DELETE trigger only 
fires if recursive triggers are enabled. Recursive triggers are currently off 
by default. 

<https://sqlite.org/lang_conflict.html>
<https://sqlite.org/pragma.html#pragma_recursive_triggers>

On December 23, 2017 7:05:59 AM EST, R Smith <ryansmit...@gmail.com> wrote:
>
>
>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

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to