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

18 lines
354 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`supplier_checkIsActive`(vSelf INT)
BEGIN
/**
* Comprueba si un proveedor esta activo.
*/
DECLARE vIsActive BOOL;
SELECT isActive INTO vIsActive
FROM vn.supplier
WHERE id = vSelf;
IF NOT vIsActive THEN
CALL util.throw('INACTIVE_PROVIDER');
END IF;
END$$
DELIMITER ;