Trigger after select
I have a sqlite3-database. There's a table with some logs. These logs are readed by a tool and were writed to a text-file (or something else) by it.
After this, the logs can be deleted. Is it possible to create a trigger in sqlite3 after a select, which automaticly deletes the logs?
Like this:
CREATE TRIGGER after_select_x
AFTER SELECT ON x
BEGIN
DELETE FROM x WH开发者_StackOverflowERE id = selected.id;
END;
But this doesn't work.
Thanks
Best regards
There is no such a thing as "Trigger after select". Check out the Trigger syntax reference.
I suggest you use a wrapper function to perform every select statement in your application, and handle the logs in that function.
精彩评论