If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > SP dependency

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-09-05, 16:01
allian allian is offline
Registered User
 
Join Date: Dec 2004
Posts: 54
SP dependency

How to findout the SP and UDF hierarchical order? for example one SP may call another SP and one UDF may call another UDF, so I would like to know the order.

Thanks
Reply With Quote
  #2 (permalink)  
Old 11-09-05, 17:07
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I guess you could find this information if you explain the corresponding packages.
Reply With Quote
  #3 (permalink)  
Old 11-10-05, 07:52
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Check out syscat.routinedep and syscat.packagedep.

Andy
Reply With Quote
  #4 (permalink)  
Old 11-10-05, 11:56
allian allian is offline
Registered User
 
Join Date: Dec 2004
Posts: 54
thanks for the replies,

but still how can I find out which SP is calling which SP?

Thanks
Reply With Quote
  #5 (permalink)  
Old 11-10-05, 12:21
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Try something like this:

select pd.bschema,pd.bname from syscat.routines as r inner join syscat.routinedep as rd on (r.routineschema = rd.routineschema and r.routinename = rd.routinename) inner join syscat.packagedep as pd on (rd.bschema = pd.pkgschema and rd.bname = pd.pkgname) where r.routineschema = 'MySchema' and r.routinename = 'MyRoutine' and rd.btype = 'K' and pd.btype = 'F'

Read the SQL Reference manual and you should be able to expand on this.

Andy
Reply With Quote
  #6 (permalink)  
Old 11-10-05, 17:27
allian allian is offline
Registered User
 
Join Date: Dec 2004
Posts: 54
This sql is not giving the correct result
Reply With Quote
  #7 (permalink)  
Old 11-11-05, 07:20
nagbuchi nagbuchi is offline
Registered User
 
Join Date: Feb 2005
Location: Bangalore,India
Posts: 39
Try this query

Can you try this query...

SELECT A.PROCNAME,B.BNAME
from SYSCAT.PROCEDURES A, SYSCAT.PACKAGEDEP B
WHERE SUBSTR(A.IMPLEMENTATION,1,8) = B.PKGNAME
AND BSCHEMA = 'TBLPY00'
AND BTYPE = 'F'
ORDER BY 1,2

NOTE : This query works only if the first 8 characters of IMPLEMENTATION represents the package name.
Reply With Quote
  #8 (permalink)  
Old 11-11-05, 11:47
allian allian is offline
Registered User
 
Join Date: Dec 2004
Posts: 54
This SQL is giving UDF name being used in SP, what about SP calls another SP?

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On