The creation and use of MySQL stored procedures 1. CREATE a stored PROCEDURE: www.2cto.com SQL code CREATE PROCEDURE proc_name (out s int) -- create a stored procedure proc_name: The out parameter in the stored procedure name parameter list indicates that the parameter is the return value. The input value is in s. The parameter name int indicates that the parameter type is BEGIN. -- the stored procedure starts to SELECT * FROM tbl_name WHERE tbl_id = s; -- This stored procedure indicates querying the END of a tbl_id result in the tbl_name table with the value of s; -- the END of the stored procedure 2. CALL the Stored Procedure SQL code SET @ p = 0; -- SET the user variable and initialize CALL proc_name (@ p ); -- CALL the CALL command to CALL the stored procedure and place the set variables in the parameter list. Note: even if the stored procedure has no variables, write (). This is consistent with the method declaration in the program. view the Stored PROCEDURE SQL code SHOW PROCEDURE STATUS 4. delete Stored PROCEDURE SQL code DROP PROCEDURE pro_name -- followed by stored PROCEDURE name