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

18 lines
352 B
SQL

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