Re: [sqlite] triggers : NEW keyword with multiple tables

2011-10-26 Thread Sébastien Escudier
> You haven't given the view explicit column names How ? > try this instead: > > CREATE VIEW my_view AS SELECT table1.type as table1_type, table2.type > as table2_type FROM Yes this works on latest version. But I wonder why the other syntax is not accepted anymore. Because I'll have to rewrite

Re: [sqlite] triggers : NEW keyword with multiple tables

2011-10-26 Thread Sébastien Escudier
> Try NEW."table1.type" and NEW."table2.type" This works with my old 3.6 version but not on 3.7.8 I still get : Error: no such column: NEW.table1.type ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] triggers : NEW keyword with multiple tables

2011-10-25 Thread Igor Tandetnik
On 10/25/2011 10:59 AM, Sébastien Escudier wrote: Hello, I used to do something like this on older sqlite versions : (this does not really makes sense here, but this is a simplified) CREATE VIEW my_view AS SELECT table1.type, table2.type FROM table1 INNER JOIN table2 ON table1.id = table2.id;

Re: [sqlite] triggers : NEW keyword with multiple tables

2011-10-25 Thread Doug Currie
On Oct 25, 2011, at 10:59 AM, Sébastien Escudier wrote: > CREATE TRIGGER my_trigger INSTEAD OF INSERT ON my_view > BEGIN > INSERT INTO table1(type) VALUES(NEW.table1.type); > INSERT INTO table2(type) VALUES(NEW.table2.type); > END; > > ... > > Why this syntax does not work anymore ? You

[sqlite] triggers : NEW keyword with multiple tables

2011-10-25 Thread Sébastien Escudier
Hello, I used to do something like this on older sqlite versions : (this does not really makes sense here, but this is a simplified) CREATE VIEW my_view AS SELECT table1.type, table2.type FROM table1 INNER JOIN table2 ON table1.id = table2.id; CREATE TRIGGER my_trigger INSTEAD OF INSERT ON