Page 1 of 1

Logging old & new values

Posted: Mon 24 Aug 2009 08:04
by devweb
Hello,

We would like to add logging capability to our application, but logging the old values & new values for each Insert/Update/Delete.

Is there any way to do that, or we should to it Manuel for each table?

I have tried to use SqlMonitor component, but it does not bring the old values.


Thanks for all.

Posted: Mon 24 Aug 2009 11:55
by swierzbicki
You should use MySQL Trigger.
See MySQL help.

Posted: Mon 24 Aug 2009 13:21
by devweb
Thanks for your suggestion, however I have these problems:

1. I use username/passwords on the application level, not the database, so how can I get the logged user who did the modifications?.

2. I need other info like Client IP, MAC add who made the modification.

3. Working on mySql triggers will require the work for each table, beside I want general way to work with other databases too.

Posted: Wed 26 Aug 2009 06:13
by Dimon
MyDAC does not provide such functionality.
To solve this problem you can use triggers or create your own handler for each table on client side.