Home >Database >Mysql Tutorial >How can we view the list of stored procedures and stored functions in a specific MySQL database?

How can we view the list of stored procedures and stored functions in a specific MySQL database?

WBOY
WBOYforward
2023-08-23 13:17:05864browse

How can we view the list of stored procedures and stored functions in a specific MySQL database?

We can view the list of stored procedures and stored functions in a specific database by using the following query on INFORMATION_SCHEMA.ROUTINES as follows:

mysql> SELECT ROUTINE_TYPE, ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA = 'query';
+--------------+--------------+
| ROUTINE_TYPE | ROUTINE_NAME |
+--------------+--------------+
| PROCEDURE    | allrecords   |
| FUNCTION     | Hello        |
+--------------+--------------+
2 rows in set (0.04 sec)

The above query returns a procedure named 'allrecords' and a function named 'Hello' stored in a database named 'query'.

The above is the detailed content of How can we view the list of stored procedures and stored functions in a specific MySQL database?. 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