解决办法:
drop trigger if exists update_account_no;
delimiter ||
CREATE TRIGGER update_account_no BEFORE UPDATE ON ld_accountscf
FOR EACH ROW
BEGIN
select concat(DATE_FORMAT(createdtime,'%Y%m%d'),'_',account_no) into @num from ld_account where accountid=OLD.accounti d;
select concat(NEW.cf_1514,'_',@num) into @new_no;
set NEW.cf_1529=@new_no;
END ||
delimiter;
drop trigger if exists update_salesorder_no;
delimiter ||
CREATE TRIGGER update_salesorder_no BEFORE UPDATE ON ld_salesordercf
FOR EACH ROW
BEGIN
select concat(DATE_FORMAT(createdtime,'%Y%m%d'),'_',salesorder_no) into @num from ld_salesorder where salesorderid=OLD.salesorderid;
select concat(NEW.cf_1476,'_',NEW.cf_1459,'_',NEW.cf_1462,'_',@num) into @new_no;
set NEW.cf_1528=@new_no;
END ||
delimiter ;
|