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

Table with Relationship between DB2table and Program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sahoo

New User


Joined: 08 Jun 2006
Posts: 53

PostPosted: Mon Jun 26, 2006 6:08 pm
Reply with quote

Hi,
Is there any system table in DB2 which maintains the relationship between Programs and the DB2 tables that are being accessed through that program?

Thanks
Sahoo
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Tue Jun 27, 2006 8:33 pm
Reply with quote

I believe these linking process will be done during precompilation..but i presume there is no system table which maintains these information...


Regards
jai
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Wed Jun 28, 2006 2:00 am
Reply with quote

Quote:
Is there any system table in DB2 which maintains the relationship between Programs and the DB2 tables that are being accessed through that program?


the relationship is stored in the the dbrm which is a prt of u r plan
Back to top
View user's profile Send private message
Sahoo

New User


Joined: 08 Jun 2006
Posts: 53

PostPosted: Wed Jun 28, 2006 1:11 pm
Reply with quote

select *
FROM SYSIBM.SYSPACKDEP
where DNAME = 'program name' and BTYPE = 'T'
Back to top
View user's profile Send private message
ravi17s
Warnings : 1

New User


Joined: 15 Aug 2003
Posts: 57

PostPosted: Thu Jun 29, 2006 5:16 pm
Reply with quote

If your are not using an Package Try this also...
SYSIBM.SYSPLANDEP

SELECT *
FROM SYSIBM.SYSPLANDEP
where DNAME = 'program name' and BTYPE = 'T'

Thanks,
Ravi.
Back to top
View user's profile Send private message
senthilssg

New User


Joined: 09 Dec 2005
Posts: 64
Location: USA

PostPosted: Thu Jun 29, 2006 8:25 pm
Reply with quote

Hi,

The following query is applicable when your program name and plan are same. (I.e. you?re each program having separate plan and name of the both should be same)

Code:
SELECT * FROM SYSIBM.SYSPLANDEP
WHERE DNAME = 'program name' and BTYPE = 'T'


Actually, having separate plan for each program is not a usual practice and not a good practice. Most of the application program is bind with package after that it bound with plan. So we can very well go with the SYSIBM.SYSPACKDEP table for the getting the info about relation between the program and table.


The following query will give the details which you wanted

Code:
SELECT BNAME  TABLE_NAME , BQUALIFIER QUALIFIER,
 DNAME  PROGRAM_NAME 
FROM SYSIBM.SYSPACKDEP WHERE BTYPE = 'T' AND BQUALIFIER='qualifier' AND DNAME=?programname?;



this is the sample output of above query

Quote:
-----------------------------------------------------------------------------
TABLE_NAME QUALIFIER PROGRAM_NAME
-----------------------------------------------------------------------------

EMP11 SSGSEN COBSTPR1
SYS_TABLE SSGSEN TRIGDATE
-----------------------------------------------------------------------------




Correct me if I am wrong


Regards

Senthil
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 Using API Gateway from CICS program CICS 0
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top