MYSQL
ERROR:
Can't update table 'xxx' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
Trigger:
CREATE
DEFINER=`jhhh`@`%`
TRIGGER `dxxx`.`pxxx_insert2_dxxx`
BEFORE INSERT ON `dxxx`.`pxxx`
FOR EACH ROW
begin
REPLACE INTO pxxx_sxxx (pxxx_cxxx)
VALUES(NEW.pxxx_cxxx);
SELECT pxxx_id INTO @temp_pxxx_id
FROM pxxx_sku WHERE pxxx_code = NEW.pxxx_code;
SET NEW.pxxx_id = @temp_pxxx_id;
end$$
No comments:
Post a Comment