Hello
I am hoping someone can help with the following problem.
- I want to create a log of all changes to tables in a database.
- I would like to keep the log table in a separate database to the
main data files
- I plan to use triggers to capture changes and insert them into the
log table.
Question:
How can I embed the 'attach" command within the trigger statement so
that the log database is attached if it is not already available?
i.e something like
create trigger insert_data after insert on data
begin
if database logdb does not exist
attach logdb.db as logdb;
insert into logdb.log values(.....)
end;
I am also a little concerned about performance so I am not sure if
testing for the presence of the database for every change will add to
much overhead. Thoughts?
Thanks
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users