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

20 lines
457 B
MySQL
Raw Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`bankEntity_checkBic`(vBic VARCHAR(255))
BEGIN
/**
* If the bic length is Incorrect throw exception
*
* @param vBic bic code
*/
DECLARE vConfigBicLenght INT;
SELECT bicLength INTO vConfigBicLenght
FROM vn.bankEntityConfig bec;
IF LENGTH(vBic) <> vConfigBicLenght THEN
CALL util.throw(CONCAT('bic must be of length ', vConfigBicLenght ));
END IF;
END$$
DELIMITER ;