IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To find the list of Dependent Tables


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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

Moderator Emeritus


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

PostPosted: Tue Sep 16, 2008 9:28 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts Need to fetch data from so many DB2 t... DB2 9
Search our Forums:

Back to Top