Knowledge Walls
John Peter
Pune, Maharashtra, India
How to use IN OUT Parameters in Mysql Stored Procedure with example
27470 Views
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;
Output 
Next Topics
Next lessons of current book.
Computer software engineer articles of One day One Thing to Know
Computer software engineer articles of One day One Thing to Know
Previous Topics
Previous lessons of current book.
Best Lessons of "One day One Thing to Know"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details