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?