DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemSaveMin`(min INT,vBarcode VARCHAR(22)) BEGIN DECLARE vItemFk INT; SELECT vn.barcodeToItem(vBarcode) INTO vItemFk; UPDATE vn.item SET minimum = min WHERE id = vItemFk; END$$ DELIMITER ;