MySQL Forums
Forum List  »  Triggers

Re: trigger to create a log file
Posted by: Roland Bouman
Date: February 07, 2006 05:43AM

No. Not in triggers anyway (or in procedures called from a trigger).

But I suggested a solution for that: just let a script generate all these tedious lines of code for you:

select concat(
'if new.'
, column_name
, ' != '
, 'old.'
, column_name
, ' then '
, ...
...
, 'end if'
)
from information_schema.columns
...
..

In most cases you can have the script generate all of you code for you. (Did you check out: http://mysql.gilfster.com/page.php?parent_id=6&page_id=6.0.2 ? Please do, that should tell you how to go about this)

Options: ReplyQuote


Subject
Views
Written By
Posted
16225
February 06, 2006 04:14AM
8109
February 06, 2006 06:32PM
4418
February 07, 2006 04:15AM
Re: trigger to create a log file
4282
February 07, 2006 05:43AM
3718
February 07, 2006 07:06AM
3773
February 07, 2006 07:22AM
3370
February 07, 2006 10:28AM
3470
February 07, 2006 02:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.