If you want to show the procedure code in MySQL, then this tutorial is for you. In this tutorial, I am going to share how to show the store procedure code syntax in MySQL.
Open the query window and copy paste below command:
1 |
SHOW PROCEDURE CODE proc_name |
In the above MySQL command, change the proc_name as your store procedure name.
Below is the complete example of Store Procedure Code Syntax
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
mysql> DELIMITER // mysql> CREATE PROCEDURE p1 () -> BEGIN -> DECLARE fanta INT DEFAULT 55; -> DROP TABLE t2; -> LOOP -> INSERT INTO t3 VALUES (fanta); -> END LOOP; -> END// Query OK, 0 rows affected (0.00 sec) mysql> SHOW PROCEDURE CODE p1// +-----+----------------------------------------+ | Pos | Instruction | +-----+----------------------------------------+ | 0 | set fanta@0 55 | | 1 | stmt 9 "DROP TABLE t2" | | 2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" | | 3 | jump 2 | +-----+----------------------------------------+ 4 rows in set (0.00 sec) |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: how to see the stored procedure in mysql, how to view created stored procedure in mysql, how to view stored procedure code in mysql, how to view stored procedure in mysql, how to view stored procedure in mysql workbench, show create procedure