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

12 lines
336 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`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 ;