I have make one procedure which has in and out parameter:
delimiter //
DROP PROCEDURE IF EXISTS empInfo ;
CREATE PROCEDURE empInfo (tblname VARCHAR(50),
clName VARCHAR(50),
out total INT)
BEGIN
SET @s = CONCAT("SELECT count(", clName ,") into total FROM ", tblname );
PREPARE stmt FROM @s;
EXECUTE stmt;
END//
Here I’m going to call above procedure in mysql.
mysql> CALL empInfo('emp','empid', @total);
It creates successfully, but when I use it – it doesn’t work properly.
seems alright to me but just dun work somehow
here is the workaround :