开发者

Error creating stored procedure [closed]

开发者 https://www.devze.com 2022-12-11 15:12 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a 开发者_如何学编程small geographic area, a specific moment in time,or an extraordinarily narrow situation that is not
This question is unlikely to help any future visitors; it is only relevant to a 开发者_如何学编程small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years ago.

Im trying to create this stored procedure:

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

I get this error

#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

The select works fine.

MySql Serverversion is 5.0.51a-log

After removing the @s im getting this error

#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 


Have you read the manual? The parameter names shouldn't have @ in front of them.

0

精彩评论

暂无评论...
验证码 换一张
取 消