Sample MySQL Stored Procedure

Sample MySQL Stored Procedure

If you are using MySQL data base and searching to sample store procedure please have one below. This is very simple store procedure which have three select statement and one input parameter and based on that this will return 3 result sets:

-- --------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- --------------------------------------------------------------------------------
DELIMITER $

CREATE DEFINER=`root`@`localhost` PROCEDURE `SelectMultiResultSet`( in departId varchar(25))
BEGIN
Select * from person;
Select * from department where DepartmentID = departId;
Select * from employee;


END
  • Sample output:

Sample MySQL Stored Procedure

  • For more information create stored procedure in MySQL data base please see this tutorial 

Leave a Reply

Your email address will not be published. Required fields are marked *