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


In reply to Re: Using Perl and MySQL for Activity Log by anonymized user 468275
in thread Using Perl and MySQL for Activity Log by PyrexKidd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.