salix/db/routines/vn/procedures/itemBarcode_update.sql

12 lines
329 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemBarcode_update`(vItemFk INT,vCode VARCHAR(22), vDelete BOOL)
BEGIN
IF vDelete THEN
DELETE FROM vn.itemBarcode WHERE itemFk = vItemFk AND code = vCode;
ELSE
INSERT INTO vn.itemBarcode(itemFk,code) VALUES (vItemFk,vCode);
END IF;
END$$
DELIMITER ;