在 db2 中如何找到所有包含给定文本的存储过程 [英] In db2 how to find all the Stored Procedures having a given text in it

查看:11
本文介绍了在 db2 中如何找到所有包含给定文本的存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道一个表是否在系统中所有存储过程的任何地方都被使用.是否有查询获取 SP 的所有详细信息.

I want to find if a table is being used anywhere in all the stored procedures in a system. Is there a query to fetch all the details of SP.

推荐答案

您可以使用 SYSCAT.TABDEP 和 SYSCAT.ROUTINEDEP 系统目录视图.

You can use SYSCAT.TABDEP and SYSCAT.ROUTINEDEP system catalog views.

对于动态 SQL 语句中动态构建和执行的表,您可以使用

For tables in Dynamic SQL statements, that are built and executed on the fly, you can use

select routinename,text from syscat.routines where language='SQL' and locate('<table-name>',text)>0

HTH

沙提亚兰

这篇关于在 db2 中如何找到所有包含给定文本的存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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