Hints
OUT parameter is used to return multiple data from mysql stored procedures. IN parameter is not session parameter. OUT parameter is at session out parameter values are accessible using @before the variable name.
|
Example program using IN, OUT param types in MYSQL Stored procedure
DROP PROCEDURE IF EXISTS sum_of_two;
DELIMITER $$
CREATE PROCEDURE sum_of_two(IN num1 INT,IN num2 INT,OUT sot INT)
BEGIN
SET sot := num1 + num2;
END
$$
-- Calling procedure here
CALL sum_of_two(2,4,@output);
-- Checking or getting output value
SELECT @output;
|