Bogdan Ureche
|
Something like this should work. CREATE TABLE [t] ( [column1] CHAR, [column2] CHAR, [column3] CHAR); CREATE TABLE [t2] ( [column1] CHAR, [column2] CHAR, [column3] CHAR); CREATE TABLE [trigger_test] ( [column2] CHAR, [column3] CHAR); CREATE TRIGGER [trigger_test_after_insert] AFTER INSERT ON [trigger_test] FOR EACH ROW BEGIN insert into t2 select * from t where t.column3 = new.column3 order by column3 desc; END; Another solution: If you want the trigger to return the values to the application that uses the sqlite library, you can try a more complex approach: 1. Install a custom function, something like record_added(column1, column2, column3). This will act like an event handler for an event triggered by the library. 2. Call the function from inside the trigger.
|