Home  >  Article  >  Database  >  How can we view the source code of a specific MySQL stored procedure?

How can we view the source code of a specific MySQL stored procedure?

PHPz
PHPzforward
2023-09-05 14:45:021425browse

How can we view the source code of a specific MySQL stored procedure?

With the SHOW CREATE PROCEDURE statement, we can see the source code of the stored procedure. To make it understandable, we use a stored procedure called allrecords() in the query as shown below -

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)

The above is the detailed content of How can we view the source code of a specific MySQL stored procedure?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete