db2的几个有用SQL

--查找函数
SELECT * FROM SYSCAT.FUNCTIONS;

--看存储过程文本
select text from syscat.procedures where procname='procedures';

--查看sp使用了哪些表
select bname from syscat.packagedep where btype='T' and pkgname in
(select bname from sysibm.sysdependencies where dname in
 (select specificname from syscat.procedures where procname='procedures'))
 
---查看影响表的SP
select PROCNAME from SYSCAT.PROCEDURES where SPECIFICNAME in(select dname from sysibm.sysdependencies
where bname in ( select PKGNAME  from syscat.packagedep where bname='table'))

你可能感兴趣的:(sql,db2)