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

20 lines
427 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_saveReference`(vBarcode VARCHAR(22), vReference VARCHAR(150))
BEGIN
/**
* Actualiza la referencia del item
*
* @param vBarcode del item
* @param vReference referencia a actualizar
*/
DECLARE vItemFk INT;
SELECT barcodeToItem(vBarcode) INTO vItemFk;
UPDATE item SET comment = vReference WHERE id = vItemFk;
END$$
DELIMITER ;