stored procedures dependencies

This is a discussion on stored procedures dependencies within the ibm-db2 forums in Other Databases category; Hi all, I'm running db2 9 on windows. I'm looking for a query to find dependencies between stored procedures. For instance if I have a procedure P that calls p1 and p2, I'd like to know that. I was looking at syscat.routinedep and syscat.packagedep but they don't seem to do the job. Even if P needs p1 and p2 to compile, it is still listed only once in the syscat.routindep catalog. Apparently this view is designed to keep the dependencies between routines and packages rather that dependencies between routines Also, the syscat.packagedep ...

Go Back   Database Forum > Other Databases > ibm-db2

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 10-28-2008, 05:23 PM
Default stored procedures dependencies

Hi all,

I'm running db2 9 on windows.
I'm looking for a query to find dependencies between stored
procedures.
For instance if I have a procedure P that calls p1 and p2, I'd like to
know that.
I was looking at syscat.routinedep and syscat.packagedep but they
don't seem to do the job.
Even if P needs p1 and p2 to compile, it is still listed only once in
the syscat.routindep catalog. Apparently this view is designed to keep
the dependencies between routines and packages rather that
dependencies between routines
Also, the syscat.packagedep show only dependencies to views, tables,
etc, but not to other packages.
Is there any way I can query this? Thanks!
Reply With Quote
  #2  
Old 10-29-2008, 07:09 AM
Default Re: stored procedures dependencies

On Oct 28, 11:23*pm, "Jon.Hakki...@gmail.com"
wrote:
> Hi all,
>
> I'm running db2 9 on windows.
> I'm looking for a query to find dependencies between stored
> procedures.
> For instance if I have a procedure P that calls p1 and p2, I'd like to
> know that.
> I was looking at syscat.routinedep and syscat.packagedep but they
> don't seem to do the job.
> Even if P needs p1 and p2 to compile, it is still listed only once in
> the syscat.routindep catalog. Apparently this view is designed to keep
> the dependencies between routines and packages rather that
> dependencies between routines
> Also, the syscat.packagedep show only dependencies to views, tables,
> etc, but not to other packages.
> Is there any way I can query this? Thanks!


Hi Jon,

Package for routine P will depend on routines P1 and P2.
So you have to find that package and look at all routine instances
which this package depends on:

SELECT C.ROUTINESCHEMA, C.ROUTINENAME
FROM SYSCAT.ROUTINES R
JOIN SYSCAT.ROUTINEDEP D ON R.ROUTINESCHEMA=D.ROUTINESCHEMA AND
R.SPECIFICNAME=D.SPECIFICNAME
JOIN SYSCAT.PACKAGEDEP P ON P.PKGSCHEMA=D.BSCHEMA AND
P.PKGNAME=D.BNAME
JOIN SYSCAT.ROUTINES C ON P.BSCHEMA=C.ROUTINESCHEMA AND
P.BNAME=C.SPECIFICNAME
WHERE R.ROUTINESCHEMA='your_schema' and R.ROUTINENAME='P' AND
D.BTYPE='K'
AND P.BTYPE='F'

Hope this help.

Sincerely,
Mark B.
Reply With Quote
  #3  
Old 10-29-2008, 11:41 AM
Default Re: stored procedures dependencies

On Oct 29, 6:09*am, 4.s...@mail.ru wrote:
> On Oct 28, 11:23*pm, "Jon.Hakki...@gmail.com"
> wrote:
>
>
>
> > Hi all,

>
> > I'm running db2 9 on windows.
> > I'm looking for a query to find dependencies between stored
> > procedures.
> > For instance if I have a procedure P that calls p1 and p2, I'd like to
> > know that.
> > I was looking at syscat.routinedep and syscat.packagedep but they
> > don't seem to do the job.
> > Even if P needs p1 and p2 to compile, it is still listed only once in
> > the syscat.routindep catalog. Apparently this view is designed to keep
> > the dependencies between routines and packages rather that
> > dependencies between routines
> > Also, the syscat.packagedep show only dependencies to views, tables,
> > etc, but not to other packages.
> > Is there any way I can query this? Thanks!

>
> Hi Jon,
>
> Package for routine P will depend on routines P1 and P2.
> So you have to find that package and look at all routine instances
> which this package depends on:
>
> SELECT C.ROUTINESCHEMA, C.ROUTINENAME
> FROM SYSCAT.ROUTINES R
> JOIN SYSCAT.ROUTINEDEP D ON R.ROUTINESCHEMA=D.ROUTINESCHEMA AND
> R.SPECIFICNAME=D.SPECIFICNAME
> JOIN SYSCAT.PACKAGEDEP P ON P.PKGSCHEMA=D.BSCHEMA AND
> P.PKGNAME=D.BNAME
> JOIN SYSCAT.ROUTINES C ON P.BSCHEMA=C.ROUTINESCHEMA AND
> P.BNAME=C.SPECIFICNAME
> WHERE R.ROUTINESCHEMA='your_schema' and R.ROUTINENAME='P' AND
> D.BTYPE='K'
> AND P.BTYPE='F'
>
> Hope this help.
>
> Sincerely,
> Mark B.


Great, it works like a charm, thanks a lot!!
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 10:03 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Integrated by bbpixel2009 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.