salix/db/routines/vn/triggers/creditInsurance_afterInsert...

12 lines
338 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`creditInsurance_afterInsert`
AFTER INSERT ON `creditInsurance`
FOR EACH ROW
BEGIN
UPDATE `client` c
JOIN vn.creditClassification cc ON cc.client = c.id
SET creditInsurance = NEW.credit WHERE cc.id = NEW.creditClassification;
END$$
DELIMITER ;