Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Selecting a row from multiple tables! Vignesh Sid DB2 2 Thu Oct 26, 2017 6:09 pm
No new posts Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm
No new posts Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us