Thomas, SQLite has the INSTEAD OF trigger to intercept/modify/compose NEW
values:

https://www.sqlite.org/lang_createtrigger.html#instead_of_trigger

I've found most situations are well handled by the INSTEAD OF trigger.   It
is powerful and somewhat comparable in functionality to stored procedure in
other SQL engines.

Since INSTEAD OF is available, the BEFORE trigger comes up only in rare
initialization or validation cases.

Do you have an example where the INSTEAD OF trigger solution is ruled out?

Peter

On Fri, Mar 30, 2018 at 11:50 PM, Thomas Kurz <[email protected]>
wrote:

> Other DBMS support the following construct in a trigger:
>
> CREATE TRIGGER name BEFORE UPDATE ON table
> FOR EACH ROW
> BEGIN
>   SET NEW.column = anyvalue
> END;
>
> In SQLite, the NEW record appearently is read-only.
>
> Support for changeable NEW records would however be graceful as it
> automatically prevents an infinite loop (recursive trigger) that can will
> more or less automatically occur otherwise when working with additional
> UPDATE-statements.
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to