How can we see the source code of a particular MySQL stored procedure?

MySQLMySQLi Database

With the help of SHOW CREATE PROCEDURE statement, we can see the source code of a stored procedure. To make it understand we are using the stored procedure named allrecords() in the query as follows −

mysql> Show Create Procedure allrecords\G
*************************** 1. row ***************************
Procedure: allrecords
sql_mode:ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Create Procedure: CREATE DEFINERb=`root`@`localhost` PROCEDURE `allrecords`()

BEGIN
Select * from Student_info;
END

character_set_client: cp850
collation_connection: cp850_general_ci
  Database Collation: latin1_swedish_ci
1 row in set (0.00 sec)
raja
Published on 21-Feb-2018 07:43:05
Advertisements