Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To find the list of Dependent Tables

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
vishal_arora

New User


Joined: 20 May 2005
Posts: 16

PostPosted: Tue Sep 16, 2008 1:19 pm    Post subject: To find the list of Dependent Tables
Reply with quote

Hi ,

My requirement is as follows :
We have a masterid and want to get a list of which all tables host this master id or in other words all the table dependenceis of this master id .

Is there any catalog query which can be executed against the master id which will fetch us the list of all the tables which hold this master id .

All replies appreciated !!
Back to top
View user's profile Send private message

Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Sep 16, 2008 4:09 pm    Post subject:
Reply with quote

Table SYSIBM.SYSCOLUMNS can be searched to get all the tables which hold this column.
Back to top
View user's profile Send private message
vishal_arora

New User


Joined: 20 May 2005
Posts: 16

PostPosted: Tue Sep 16, 2008 4:29 pm    Post subject: Reply to: To find the list of Dependent Tables
Reply with quote

Thanks Manu ....

But i think i did'nt explained it right to the forum .... my mistake ..

Requirement is :

Suppose the Master_id column contains value such as : 'FT1099987'
and i want all the tables where master_id='FT1099987' resides.

I.e The list of tables which holds this 'FT1099987' .

SYSIBM.SYSCOLUMN provided me the tables list which holds the column MASTER_ID whereas my query is for a value contained inthis field.


Hope i am clear this time .... Pls post the query if anyone knows..
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 16, 2008 9:28 pm    Post subject:
Reply with quote

Hello,

Quote:
Pls post the query if anyone knows..
I believe there is no single query that will do this.

If this was my requirement, i'd write a query that identifies all of the tables with the "master_id" column. Then, i'd use that list of tables to generate a "select count(*) from xxx where master_id = 'FT1099987' " query for each table in the list and execute that collection of queries. All of the non-zero counts would be a table containing the value you are looking for. Hopefully, master_id is a key. . .
Back to top
View user's profile Send private message
tarun_bhardwaj

New User


Joined: 18 Jul 2003
Posts: 39
Location: delhi

PostPosted: Thu Sep 18, 2008 1:20 am    Post subject: Reply to: To find the list of Dependent Tables
Reply with quote

You can do it by writing a REXX. I have written a REXX tool for this earlier but am not sure how apt it would be with your environment.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts To know activities on db2 tables ashek15 DB2 4 Fri Mar 03, 2017 11:23 pm
No new posts ERM-Diagram of SysIBM-Catalog-Tables Auryn DB2 2 Fri Feb 17, 2017 6:22 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us