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
Release: 2023-08-23 13:17:05
forward
857 people have browsed it

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template