I appreciate the discussion thus far.

I tried the following syntax:

CREATE TRIGGER update_history_table_trigger INSTEAD OF UPDATE ON
history_table
BEGIN
UPDATE history_table SET new_value = 1 WHERE 0 = 1;
END ;

CREATE TRIGGER delete_history_table_trigger INSTEAD OF DELETE ON
history_table
BEGIN
DELETE FROM history_tble WHERE 0 = 1;
END ;

...received the following error:  "cannot create INSTEAD OF trigger on
table: history_table"

Googling revealed the following link from 2012:

http://stackoverflow.com/questions/9487381/why-sqlite-error-cannot-create-instead-of-trigger-on-table

...which states that INSTEAD OF triggers are to be used with views, not
tables.  Is this still true?  I'm using SQlite 3.8.9.

Thanks, again.

On Sun, Sep 20, 2015 at 6:34 PM, Simon Slavin <slavins at bigfraud.org> wrote:

>
> On 21 Sep 2015, at 12:21am, James Hartley <jjhartley at gmail.com> wrote:
>
> > I am assuming that dropping the trigger
> > will re-enable any action which had been disabled by creating the
> trigger.
> >
> > Is this incorrect?
>
> Nope.  That's one way to do it.  Another is to set "PRAGMA
> recursive_triggers = OFF" then have a TRIGGER make changes to the table.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

Reply via email to