Creating a Stored Procedure
A stored procedure is defined using the CREATE PROCEDURE statement. Argument variables to be passed in to a stored procedure through the CALL statement can be declared to be input, output, or both input and output. A stored procedure can optionally return to the calling program one or more SELECT statement result sets. The syntax for CREATE PROCEDURE is as follows.