Reputation: 10969
Can you not do the following w/ MySQL stored procedures?/
DROP PROCEDURE IF EXISTS `test`;
DELIMITER //
CREATE PROCEDURE TEST (team varchar(30))
BEGIN
SELECT * FROM TEAMS WHERE TEAM_ID = @team;
END
//
Where @team (or team) is the variable passed to the stored procedure?
Upvotes: 2
Views: 7142
Reputation: 332661
You need to use:
DROP PROCEDURE IF EXISTS `test`;
DELIMITER //
CREATE PROCEDURE TEST (IN_TEAM_ID varchar(30))
BEGIN
SELECT t.*
FROM TEAMS t
WHERE t.team_id = IN_TEAM_ID;
END //
DELIMITER ;
There's no @ notation when referencing stored procedure parameters.
Upvotes: 8