此存储过程有什么问题? [英] What is wrong with this stored procedure?
问题描述
对于以下MySQL SP,我一直收到此错误 有什么想法吗?
I keep getting this error for the below MySQL SP any ideas?
创建过程productpricing(
OUT pl DECIMAL(8,2),OUT ph DECIMAL(8,2),OUT PA DECIMAL(8,2)) 开始选择最小值(金额)放入PL FROM Card错误代码:1064您有一个 您的SQL语法错误;检查 对应于您的MySQL的手册 正确语法的服务器版本 在第9 0.000秒的行附近使用
CREATE PROCEDURE productpricing(
OUT pl DECIMAL(8,2), OUT ph DECIMAL(8,2), OUT pa DECIMAL(8,2) ) BEGIN SELECT Min(amount) INTO pl FROM Card Error Code: 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 9 0.000 sec
DROP PROCEDURE IF EXISTS productpricing;
CREATE PROCEDURE productpricing(
OUT pl DECIMAL(8,2),
OUT ph DECIMAL(8,2),
OUT pa DECIMAL(8,2)
)
BEGIN
SELECT Min(amount)
INTO pl
FROM Card;
END;
推荐答案
您是否定义了定界符?
Did you define a delimiter?
尝试在CREATE PROCEDURE
语句之前添加delimiter //
.同样,将END;
替换为END;//
.我检查了一下,对我有用.
Try adding delimiter //
before the CREATE PROCEDURE
statement. Also replace END;
with END;//
. I checked and it works for me.
这篇关于此存储过程有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!