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

20 lines
431 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`vn-admin`@`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 ;