Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / July 2006

Tip: Looking for answers? Try searching our database.

Procedure Dependencies and Temporary Tables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
phil@querytool.com - 18 Jul 2006 23:53 GMT
I have been developing some queries which will list the dependencies of
Stored Procedures (this is with DB2/UDB v8). In doing so, I have
noticed that dependencies are ignored if they occur in an insert into a
temporary table. For instance, if you have the following procedure:
CREATE PROCEDURE DBA.TEST
BEGIN
   INSERT INTO SESSION.TEMP1 SELECT COUNT(*) FROM DBA.DEPARTMENT;
END
Then DBA.DEPARTMENT will not appear in the list of dependent objects
for this procedure. If you instead have (say) "INSERT INTO sometable
SELECT COUNT(*) FROM DBA.DEPARTMENT;" then DBA.DEPARTMENT will appear
in the dependency list.

Note that to get the dependency list I access SYSCAT.ROUTINEDEP with
the specific-name of the procedure - this gives me a package name, with
which I look up SYSCAT.PACKAGEDEP.

Perhaps, because temporary tables are not held in catalog, the insert
into the temporary table is ignored when DB2 is compiling the list of
dependent objects. Does anyone know whether this is the case, and
whether there is any way to get the list of dependent objects for
Stored Procedures such as these?

Thanks!
Phil Castle
Serge Rielau - 19 Jul 2006 02:15 GMT
> I have been developing some queries which will list the dependencies of
> Stored Procedures (this is with DB2/UDB v8). In doing so, I have
[quoted text clipped - 18 lines]
> whether there is any way to get the list of dependent objects for
> Stored Procedures such as these?
Your guess is correct. Any statement with "SESSION" in it is treated as
"VALIDATE RUN" that is it is not compiled untile first execution. Thus
no dependencies.

Cheers
Serge
Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ondemandbusiness/conf2006/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.