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

9 lines
340 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn2008`.`movement_label_afterUpdate`
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 ;