|Subject||Re: [firebird-support] detect if database has changed|
|Author||Walter R. Ojeda Valiente|
There are several ways for doing that.
One of them, is to create a table, called CHANGES, by example, and with the columns: TABLENAME, USERNAME, DATEANDTIME, etc.
Then, for each table of your interest, you create a trigger which inserts a row in the table CHANGES when a user do an INSERT, UPDATE, or DELETE in such table.
This way, you can always know when was the last time someone did an INSERT, UPDATE, or DELETE in the interesting tables.
If you want a table with few rows, then you can have in your table CHANGES a row for each table and the columns LASTINSERT, LASTUPDATE, LASTDELETE. So, if you are interested in 20 tables, your table CHANGES will have 20 rows. The problem will be the frequents deadlocks if you don't manage well your transactions.
On Mon, Oct 9, 2017 at 5:06 AM, liviuslivius liviuslivius@... [firebird-support] <email@example.com> wrote:Hi,You can also look at sample atIt is in PL lang but triggers are fully descriptive. I prefer generator based approachRegards,Karol Bieniaszewski