I'm Building Audit Trail with Trigger, and want to convert the inserted / updated / deleted value into XML and store it into another table.
my trigger look like this:
DELIMITER $$ CREATE TRIGGER `MyDB`.`TriggerAudit` AFTER INSERT ON `MyDB`.`settings` FOR EACH ROW BEGIN INSERT INTO insert_audit_trail (user_uid, table_name, inserted_value) VALUES ('the Username', 'the table name', 'Select to XML In Here') END$$ DELIMITER ;
Normally in MSSQL I can use FOR XML function, but in I Don't know to do this in MySQL. Is there any solutions for this?