Is it possible to pass the NEW and the OLD tables from a trigger into a procedure in MySQL? -
is possible pass new , old tables trigger procedure in mysql? suspect no, since there no such datatype table procedure accepts. workarounds possible?
ideally this:
create trigger product_log after update on product each row begin call logchanges(old, new); end;
you can explicitly pass each field:
call logchanges(old.cola, old.colb, new.cola, new.colb); or if logchanges must sufficiently generic can handle such calls different tables, 1 concatenate field values single string using suitable delimiter (e.g. unit separator):
call logchanges(concat_ws(char(31), old.cola, old.colb), concat_ws(char(31), new.cola, new.colb)); or if data types must preserved, 1 insert records temporary logchanges reads.
Comments
Post a Comment