473,748 Members | 3,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.routined ep and syscat.packaged ep 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.routinde p catalog. Apparently this view is designed to keep
the dependencies between routines and packages rather that
dependencies between routines
Also, the syscat.packaged ep show only dependencies to views, tables,
etc, but not to other packages.
Is there any way I can query this? Thanks!
Oct 28 '08 #1
2 5736
On Oct 28, 11:23*pm, "Jon.Hakki...@g mail.com" <Jon.Hakki...@g mail.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.routined ep and syscat.packaged ep 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.routinde p catalog. Apparently this view is designed to keep
the dependencies between routines and packages rather that
dependencies between routines
Also, the syscat.packaged ep 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.ROUTINED EP D ON R.ROUTINESCHEMA =D.ROUTINESCHEM A AND
R.SPECIFICNAME= D.SPECIFICNAME
JOIN SYSCAT.PACKAGED EP P ON P.PKGSCHEMA=D.B SCHEMA AND
P.PKGNAME=D.BNA ME
JOIN SYSCAT.ROUTINES C ON P.BSCHEMA=C.ROU TINESCHEMA AND
P.BNAME=C.SPECI FICNAME
WHERE R.ROUTINESCHEMA ='your_schema' and R.ROUTINENAME=' P' AND
D.BTYPE='K'
AND P.BTYPE='F'

Hope this help.

Sincerely,
Mark B.
Oct 29 '08 #2
On Oct 29, 6:09*am, 4.s...@mail.ru wrote:
On Oct 28, 11:23*pm, "Jon.Hakki...@g mail.com" <Jon.Hakki...@g mail.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.routined ep and syscat.packaged ep 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.routinde p catalog. Apparently this view is designed to keep
the dependencies between routines and packages rather that
dependencies between routines
Also, the syscat.packaged ep 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.ROUTINED EP D ON R.ROUTINESCHEMA =D.ROUTINESCHEM A AND
R.SPECIFICNAME= D.SPECIFICNAME
JOIN SYSCAT.PACKAGED EP P ON P.PKGSCHEMA=D.B SCHEMA AND
P.PKGNAME=D.BNA ME
JOIN SYSCAT.ROUTINES C ON P.BSCHEMA=C.ROU TINESCHEMA AND
P.BNAME=C.SPECI FICNAME
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!!
Oct 29 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1983
by: SQLServer007 | last post by:
25 more days until the "get it free" promotion runs out for xSQL Object (you can get it from http://www.x-sql.com) Here are just some of the great features packed in the product: - Compare SQL Server objects (databases, tables, views, stored procedures, user defined data functions etc.) accross servers. - view and print dependencies; - generate color coded scripts for any object in the database or many of them at once (many configurable...
6
2047
by: dwilliams | last post by:
Our organization has implemented an ASP.net application with an n-tiered architecture, made up of a business/data layer that calls T-SQL Stored procedures. We are attempting to better manage the many stored procedures we have written over the life of the application. To do this, we would like to determine which sprocs are being called from which asp.net page. As all Sproc calls are made through the business layer, we really want to map...
2
9244
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered problems doing this. I wanted to implemented a generic "Helper" class like this: /** * Helper
5
3485
by: Tim Marshall | last post by:
I was following the thread "Re: Access Treeview - Is it Safe Yet?" with interest and on reading the post describing Lauren Quantrell's SmartTree, I've run into something I don't understand: Stored Procedures. I thought stored pricedures were an Oracle/MS SQL Server thing and don't know how they work with Access Jet. I've looked at some of the help on stored procedures in A2003, but really don't understand what's going on. Can someone...
28
72539
by: mooreit | last post by:
The purpose for my questions is accessing these technologies from applications. I develop both applications and databases. Working with Microsoft C#.NET and Microsoft SQL Server 2000 Production and 2005 Test Environments. What is the purpose of a view if I can just copy the vode from a view and put it into a stored procedure? Should I be accessing views from stored procedures?
2
4508
by: Praveen_db2 | last post by:
Hi All DB2 8.1.3, Windows Is there any method to find the routines dependant on any particular routine. Say, I have a stored procedure PROC1 which calls 2 stored procedures and is called by 3 stored procedures. Is there any method to find the names or atleast packages of these stored procedures which are called by PROC1 and are calling PROC1? Is something there in SYSCAT.ROUTINEDEP or SYSCAT.PACKAGEDEP which can be
8
8698
by: rick | last post by:
Hi I m trying to move only stored procedures from one database to another and also onto a database on another server, I tried db2 -x "select text from syscat.procedures where procschema = 'MYSCHEMA'" | tee /esa/home/sasha/MY_SCHEMA_SP.txt, how ever all the procedures are getting loaded to the file but some stored procedures are getting truncated because they are too big , I also tried to use getroutine but the problem is we have 600...
1
1407
by: dherbstemail-ng | last post by:
I can get the SQL Server 2005 CommandNotification cache dependency to work with inline SQL. It works in a SqlDataSource as well as with the page OutputCache when making ADO.NET calls. Next I copy/paste the exact same inline SQL into a stored procedure wrapper and switch my SqlDataSource or ADO.NET code to call the stored procedure. Now the cache is no longer refreshed after data in the query results has been changed. Has anyone been...
11
3441
by: peter | last post by:
I am trying to get a SQL stored procedure to use user maintained MQT implicitly which raises questions on when they are used or not used. In theory you would expect the stored procedure to pick up the MQT at the time it is bound on the creation of the static SQL. This raises the question on how you stop it or start it using a MQT as there is no option on the bind. What happens when it is rebound? What happens if the plan is made invalid...
0
8987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.