View previous topic :: View next topic
|
Author |
Message |
Sahoo
New User
Joined: 08 Jun 2006 Posts: 53
|
|
|
|
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 |
|
|
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
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 |
|
|
vijayamadhuri
Active User
Joined: 06 Apr 2005 Posts: 180
|
|
|
|
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 |
|
|
Sahoo
New User
Joined: 08 Jun 2006 Posts: 53
|
|
|
|
select *
FROM SYSIBM.SYSPACKDEP
where DNAME = 'program name' and BTYPE = 'T' |
|
Back to top |
|
|
ravi17s Warnings : 1 New User
Joined: 15 Aug 2003 Posts: 57
|
|
|
|
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 |
|
|
senthilssg
New User
Joined: 09 Dec 2005 Posts: 64 Location: USA
|
|
|
|
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 |
|
|
|