I am trying a stored procedure with a parameter for the first time. Apparently it does not like the parameter. I have tested just the select statement by itself and it returns the correct results.
create procedure view_single_item (IN id INT)
BEGIN
SELECT A.ARTIST,D.DISC_TITLE, D.DISC_CATNO,
D.MANUF, D.IPS, L.LABEL_NAME,D.FORMAT
FROM CD_DATA D LEFT JOIN CD_ARTIS A ON D.ARTIST_NO=A.ARTIST_NO
LEFT JOIN CD_LABEL L ON D.DISC_LABEL = L.LABEL_NO
WHERE disc_seq = id
END
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 'SELECT A.ARTIST,D.DISC_TITLE, D.DISC_CATNO, D.MANUF, D.IPS, L.LABEL_NAME,D.FOR' at line 3
Syntax from manual:
CREATE PROCEDURE sp_name ([proc_parameter[,...]])
[characteristic ...] routine_body
Unfortunately there is no useful example in the manual