MySQL Forums
Forum List  »  Triggers

Trigger as a LOG
Posted by: lorenzo pellergini
Date: October 30, 2006 02:31AM

I'd like to create a trigger that works as a LOG..
So i'd like to write in the table MYLOG, for every UPDATE on my table DATA the username of the author of that UPDATE, and the current STATEMENT that modified the database..
So my trigger is something like:

CREATE TRIGGER tr_update after UPDATE ON MYTABLE
for each row
insert into MYLOG values (CURRENT_USER,'CURRENTSTATEMENT');

The problem is that i don't know where i can find the information on the CURRENT STATEMENT..
does it exist a environmental variable with this information?
How to find it?
Thanks a lot!
Lorenzo

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger as a LOG
2385
October 30, 2006 02:31AM


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.