Example of Stored Procedure using INOUT mode parameter:
INOUT mode is used when you pass and want to get the result using same parameter. Using INOUT mode parameter we can pass the argument to the Stored Procedure and also can get the result with that same parameter.
Example of INOUT mode parameter :
DELIMITER $$
CREATE PROCEDURE GetSquare(INOUT num int(4) default 0)
BEGIN
SET result = num * num ;
END $$
Now we call the function GetSquare :
SET @num = 25;
Call GetSquare(@num);
select @result;
Output :
625
0 Comment(s)