On 6/9/17, Mark Brand <[email protected]> wrote: > > > On 09/06/17 14:47, Richard Hipp wrote: >> The documentation has been updated to clarify the ambiguity and to >> hopefully make it easier to understand. > > Thanks. The exception for non-TEMP triggers is something I was hoping > for too: > >> For non-TEMP triggers, the table to be modified or queried must exist >> in the same database as the table or view to which the trigger is >> attached. TEMP triggers are not subject to the same-database rule. A >> TEMP trigger is allowed to query or modify any table in any ATTACH >> <https://sqlite.org/lang_attach.html>-ed database. > > But it doesn't seem to work this way yet. (3.19.3). Is this a coming change?
The <schema>.<table> syntax restriction (the fact that you can only have <table> and not <schema>.<table> instead of triggers) is universal. It applies to both TEMP trigger and non-TEMP triggers. Only the semantic rule that the referenced <table> must be within the <same> schema is relaxed for TEMP triggers. > > > create table t (x); > insert into t values (0); > create temp view v as select * from t; > > create temp trigger trg1 instead of update on temp.v > begin > update temp.t set x = new.x; > end; > > Error: near line 5: qualified table names are not allowed on INSERT, > UPDATE, and DELETE statements within triggers > > > _______________________________________________ > sqlite-users mailing list > [email protected] > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp [email protected] _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

