I am creating a trigger in MySQL to tell me that WHO (which mysql user) is updating in a specific table.
I know that MySQL has the CURRENT_USER () function, but do I need to insert a username during CREATED start or during a CALLED call?
This is my trigger so far. I want to insert the username in the column "content".
delimiter | CREATE TRIGGER update_product_procedure BEFORE UPDATE ON product_procedure FOR EACH ROW BEGIN INSERT INTO trigger_logs SET content = 'This is a test', postDate=NOW(); END; |
source share