salix/db/routines/vn2008/triggers/movement_label_au.sql

9 lines
331 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn2008`.`movement_label_au`
AFTER UPDATE ON `movement_label`
FOR EACH ROW
IF NEW.stem >= (SELECT Cantidad FROM Movimientos WHERE Id_Movimiento = NEW.Id_Movimiento) THEN
UPDATE Movimientos SET OK = 1 WHERE Id_Movimiento = NEW.Id_Movimiento;
END IF$$
DELIMITER ;