2
我正在导入一个存储过程,我刚刚从我的开发服务器导出到我的生产过程中,并且遇到了以下phymyadmin错误。导入存储过程时导致MYSQL错误1064
SQL query: Documentation
$$ CREATE DEFINER = `devuser`@`localhost` FUNCTION `get_refundable_amount` (
enrol_id INT
) RETURNS double(10, 2) READS SQL DATA BEGIN DECLARE refundable_amount double(10, 2) DEFAULT 0;
SELECT (
sum(P.amount) - EI.amount
)
INTO refundable_amount
FROM site_payment_processed AS P
INNER JOIN site_user_enroled AS E ON (P.enrol_id = E.id
AND P.payment_type = 'Refund')
INNER JOIN site_user_enroled_invoice AS EI ON EI.enrol_id = E.id
WHERE E.id = enrol_id
GROUP BY E.id;
RETURN (
refundable_amount
);
END$$
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$
CREATE DEFINER=`devuser`@`localhost` FUNCTION `get_refundable_amount`' at line 1
请提供代码说明。 – 2012-11-06 05:15:09