4 forum posts by user pythonizer
|14:31||• Reply: Odd behaviour of UNION (artifact: de98a07811 user: pythonizer)|
Post: Odd behaviour of UNION
(artifact: 1c3480e403 user: pythonizer)
Consider the following simple scenario:
I want to get the highest and second highest values in c2. I know this is very simple, but I was explaining this to someone else and they asked how they could use UNION for this.
However, this just gives me:
I would expect it to give me 90 and 100.
Reply: Statement that fires trigger is not executed when the trigger causes an error
(artifact: 9c8232c1b7 user: pythonizer)
Very clear and concise. I get it now. Thank you!
Post: Statement that fires trigger is not executed when the trigger causes an error
(artifact: 05f1133f7c user: pythonizer)
I'm trying to understand what is the default behaviour of SQLite when there is an error in the BEGIN-END section of a trigger.
CREATE TABLE my_table (id INTEGER PRIMARY KEY); INSERT INTO my_table VALUES (1); CREATE TRIGGER R1 AFTER DELETE ON my_table BEGIN DELETE FROM Non_existent_table WHERE id=OLD.id; END;
So I created a table and then added a trigger that is doomed to fail.
If I try to remove something from
DELETE FROM my_table WHERE id=1; Error: no such table: main.Non_existent_table
Now, since I'm using AFTER DELETE on the trigger, I would expect that the original DELETE statement on
SELECT * FROM my_table; id
Why is the original statement that caused the trigger to fire, not executed when there is an error on the trigger?
Anyway, this may be a stupid question, but it's really bugging me that I can't figure it out.