查找所有MySQL存储过程调用? [英] Find all MySQL Stored Procedure calls?

查看:61
本文介绍了查找所有MySQL存储过程调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我偶尔使用和修改的给定MySQL数据库,我最近不得不对某些表和存储过程进行一些更改.该数据库中的某些地方,过程可以调用其他过程.我发现在所有需要修改这些修改过的过程的参数的地方都麻烦地寻找任务,并求助于转储数据库并在转储的文件上进行文本搜索以找到所有的CALL语句.

For a given MySQL DB that I use and modify occasionally I had to recently make some changes to some tables and stored procedures. There are places in this DB where procedures make calls to other procedures. I found the task of hunting down everywhere that I needed to modify the parameters to these modified procedures a hassle and resorted to dumping the DB and doing a text search on the dumped file to find all the CALL statements.

我想知道是否有更好,更轻松的方法来做到这一点.我在SO上做了一些粗略的搜索,还用谷歌搜索了一个解决方案,但实际上没有找到答案.我怀疑有一种方法可以列出已进行的调用或其中的某个实用程序,使之变得简单,但是我没有找到这种解决方案.

I'm wondering if there's a better and easier way to do this. I did some cursory searching here on SO and also googled for a solution but really didn't find an answer. I suspect that there's a way to come up with a list of the calls made or some utility out there that makes it simple, but I haven't found this solution.

有什么想法吗?

推荐答案

好吧,我终于偶然发现了以下解决方案:

Well, I finally stumbled upon the following solution:

INFORMATION_SCHEMA.ROUTINES表中的信息在尝试将CALL从一个SP跟踪到另一个SP时非常有用.我使用了以下内容:

The INFORMATION_SCHEMA.ROUTINES table has information that can be very useful when trying to track down CALLs from one SP to another. I used the following:

SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE "%SomeProc%";

这将检索包含SomeProc的所有存储过程.

And this retrieved all the store procedures that contained SomeProc.

这篇关于查找所有MySQL存储过程调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆