简体   繁体   English

从MySQL数据库中获取存储过程

[英]Fetching Stored Procedure from the MySQL database

Is there any tool to find out stored-procedure and its parameters list from the database? 有没有工具可以从数据库中找出存储过程及其参数列表? I am just implementing in to the swing application where user will give the database name only and on the basis of db name i have to fetch all the stored procedure and its parameter. 我只是在swing应用程序中实现,用户只给出数据库名称,并且在db名称的基础上我必须获取所有存储过程及其参数。

You can use: SELECT name,param_list FROM mysql.proc WHERE db='your_database' and type='procedure'; 您可以使用: SELECT name,param_list FROM mysql.proc WHERE db='your_database' and type='procedure'; to retrieve the list of all procedures and their parameters. 检索所有过程及其参数的列表。

SHOW PROCEDURE STATUS

will show you the available stored procedures. 将显示可用的存储过程。

For fetching procedures for a particular database, use - 要获取特定数据库的过程,请使用 -

SHOW PROCEDURE STATUS 
WHERE Db = 'your_database_name';

See this answer for a more detailed explanation. 有关更详细的说明,请参阅答案。

Take a look at DBVisualizer . 看看DBVisualizer It will show you everything that is related to your database including your stored procedures. 它将显示与数据库相关的所有内容,包括存储过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM