也许有人可以帮助解决此问题:
CREATE FUNCTION inc_btw (prijs DECIMAL(5,2), btw DECIMAL(3,2))
RETURNS DECIMAL(5,2)
DETERMINISTIC
BEGIN
DECLARE inc_btw DECIMAL(10,2);
inc_btw = (prijs*(btw+100))/100;
RETURN inc_btw;
END;
我觉得这很好,但是我收到了一个错误:
#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 '' at line 5
答案 0 :(得分:0)
尝试摆弄你的分隔符:
delimiter $$
CREATE FUNCTION inc_btw (prijs DECIMAL(5,2), btw DECIMAL(3,2))
RETURNS DECIMAL(5,2)
DETERMINISTIC
BEGIN
DECLARE inc_btw DECIMAL(10,2);
set inc_btw = (prijs*(btw+100))/100;
RETURN inc_btw;
END$$
delimiter;
答案 1 :(得分:0)
尝试这样做(使用delimiter
,但set
inc_btw = (prijs*(btw+100))/100;
DELIMITER $$
CREATE FUNCTION inc_btw (prijs DECIMAL(5,2), btw DECIMAL(3,2))
RETURNS DECIMAL(5,2)
DETERMINISTIC
BEGIN
DECLARE inc_btw DECIMAL(10,2);
set inc_btw = (prijs*(btw+100))/100;
RETURN inc_btw;
END;
$$
DELIMITER ;
答案 2 :(得分:0)
delimiter $$
CREATE FUNCTION inc_btw (prijs DECIMAL(5,2), btw DECIMAL(3,2))
RETURNS DECIMAL(5,2)
DETERMINISTIC
BEGIN
DECLARE inc_btw DECIMAL(10,2);
set inc_btw = (prijs*(btw+100))/100;
RETURN inc_btw;
END$$