View stored procedure/function definition in MySQL
SHOW CREATE PROCEDURE <name>
Returns the text of a previously defined stored procedure that was created using the CREATE PROCEDURE
statement. Swap PROCEDURE
for FUNCTION
for a stored function.
You can use this:
SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = 'yourdb' AND ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_NAME = "procedurename";