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

18 lines
352 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
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 ;