[ACCEPTED]-Show procedure/function code in MySql-procedure
Accepted answer
try "SHOW CREATE PROCEDURE procedurename"
0
Yes,
SELECT ROUTINE_DEFINITION FROM information_schema.ROUTINES WHERE SPECIFIC_NAME='procedurename'
0
I've been experimenting a bit, and I think 7 one of the following two works best.
To list 6 everything (parameters
, collating
, etc.), use this.
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA in (SELECT DATABASE()) AND ROUTINE_NAME='ProcedureName';
To list 5 only the code, use this.
SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA in (SELECT DATABASE()) AND ROUTINE_NAME='ProcedureName';
In both of the above, the 4 nested select is required to limit the result 3 to the current database, since INFORMATION_SCHEMA
, being the 2 system database, contains details for every 1 database installed in the instance.
Go to mySQL workbench
- Right click on procedure and then select ALTER. (This Will open the definition of procedure for you(is the easiest way).
OR
- You can also use the command, SHOW
CREATE PROCEDURE proc_name
;
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.