SHOW CREATE PROCEDURE proc_name
The SHOW CREATE PROCEDURE statement returns the exact string used to create the specified stored procedure.
To use this statement, you must satisfy at least one of the following conditions:
DEFINER of the routine.SHOW_ROUTINE privilege.SELECT privilege at the global level.CREATE ROUTINE, ALTER ROUTINE, or EXECUTE privilege on the routine.If you have only the CREATE ROUTINE, ALTER ROUTINE, or EXECUTE privilege, and none of the first two conditions apply, the Create Procedure field in the result set returns NULL.
For more information, see the MySQL documentation: SHOW CREATE PROCEDURE Statement.