Show procedure/function code in MySql
26,076
Solution 1
try "SHOW CREATE PROCEDURE procedurename"
Solution 2
Yes,
SELECT ROUTINE_DEFINITION FROM information_schema.ROUTINES WHERE SPECIFIC_NAME='procedurename'
Author by
User129
Updated on December 22, 2020Comments
-
User129 over 3 years
Is there any options to view stored procedure/function code in MySql same as like "sp_helptext procedurename" in sql?
-
jave.web about 10 years1. SHOW with CREATE is usually available, (just SHOW is only available in debug mode)........................ 2. This shows the whole CREATE code of the function/procedure.
-
jave.web about 10 yearsAlso note that of course you can switch
procedure
keyword withfunction
to get the function create code:::::SHOW CREATE FUNCTION function_name
-
jave.web about 10 yearsThis shows what the function/procedure CONTAINS - what is to be executed, not the whole "create function/procedure" code.