salix/db/routines/vn/triggers/item_beforeUpdate.sql

15 lines
314 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`item_beforeUpdate`
BEFORE UPDATE ON `item`
FOR EACH ROW
BEGIN
DECLARE vNewPackingShelve INT;
SET NEW.editorFk = account.myUser_getId();
IF NEW.itemPackingTypeFk = '' THEN
SET NEW.itemPackingTypeFk = NULL;
END IF;
END$$
DELIMITER ;