Wednesday, December 28, 2011

Find the programs using a particular table

In development, most of the time, we will be expanding DB2 tables to introduce new fields. In those situations, we need to find out the programs impacted by a table expansion.

The below simple SQL query will give you the list of programs using a particular table.

SELECT SUBSTR(BNAME,1,20) AS TABLE             
      ,SUBSTR(DNAME,1,8)  AS PGM_NAME          
  FROM SYSIBM.SYSPACKDEP                   
 WHERE                                    
    BQUALIFIER = 'TABQUAL' AND              
    BNAME      = 'TEST_TBL_NAME' ;

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.