DELIMITER $$
USE bodb
$$
DROP FUNCTION IF EXISTS Fn_XIRR
$$
CREATE DEFINER=rxqueryuser
@%
FUNCTION Fn_XIRR
(issue_date DATE) RETURNS DECIMAL(38,9)
DETERMINISTIC
BEGIN
DECLARE ytm_tmp DECIMAL (20,4);
DECLARE ytm DECIMAL (20,4);
DECLARE pv_tmp DECIMAL (20,4);
DECLARE pv DECIMAL (20,4);
DECLARE t DECIMAL (20,4);
SET ytm_tmp =...