in reply to Using Perl and MySQL for Activity Log

I would have suggested using triggers as well but for bart's valid point and because the version in question of MySQL is barely a year old.

However, stored procedures have been around in MySQL for 8 years. So it seems reasonable to write access stored procedures that have the logging to log tables built in. Calling these from Perl instead of coding SQL in the Perl code is usually preferable anyway. There are overheads to dragging data out of the database, processing it and putting it back. As a rule it is better to let Perl pre- or post-process database data but to use stored procedures where possible, especially if the database is on a different machine from where the Perl will run. A trigger is anyway a special case of a stored procedure.

One world, one people

  • Comment on Re: Using Perl and MySQL for Activity Log