views:

39

answers:

1

Hi

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
+4  A: 

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

Lukáš Lalinský
That was definitely an error, guess is was thinking mssql instead of mysql. However thats not the only error
CruelIO
You are missing a semicolon. You should read the linked docs.
Lukáš Lalinský