创建存储过程时出错

时间:2009-11-13 21:25:14

标签: mysql stored-procedures mysql-error-1064

我正在尝试创建此存储过程:

CREATE PROCEDURE GetExif 
(
IN @album VARCHAR(50), 
IN @pic VARCHAR(50)
)
BEGIN

SELECT CAMERA, 
FSTOP, 
EXPOSURE, 
ISO, 
FOCALLENGHT, 
DATETAKEN, 
GPSLATH, 
GPSLONG
FROM EXIF
WHERE ALBUMNAME = @album 
AND PICTURENAME = @pic

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 '@album VARCHAR(50),  IN @pic VARCHAR(50) ) BEGIN

SELECT CAMERA,  FSTOP,  ' at line 3

选择工作正常。

MySql Serverversion是5.0.51a-log

删除@s即时收到此错误

#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 'END' at line 20 

1 个答案:

答案 0 :(得分:4)

您是否阅读过manual?参数名称前面不应有@