MySQL Stored Procedure Parameters are NULL

Posted by emmilely on Server Fault See other posts from Server Fault or by emmilely
Published on 2011-02-11T21:41:03Z Indexed on 2011/02/11 23:27 UTC
Read the original article Hit count: 344

Filed under:
|
|

I am stumped, and was hoping someone here would have a quick and easy answer. I did a fresh install of MySQL 5.5 and am trying to pass parameters into a stored procedure. The parameter values aren't being read by the stored procedure. MySQL doesn't throw an error and processes the code with null parameters. Here is the code:

DELIMITER $$

CREATE DEFINER=`root`@`%` PROCEDURE `testing`(IN parameter INTEGER)
BEGIN
    UPDATE table_name SET valueToChange = 'Test' WHERE mainID = @parameter;
END

And here is the query I'm using to call it:

USE database_name; CALL testing(72);

Can anyone help?

© Server Fault or respective owner

Related posts about mysql

Related posts about parameters