Any Utility to expand DB2 SQL statements in DBRMLIB?



IBM's flagship relational database management system

Any Utility to expand DB2 SQL statements in DBRMLIB?

Postby kalisgox » Mon Aug 04, 2014 1:22 pm

Hi,

I have a requirement to get the list of programs that uses a table (which i obtained from SYSTABAUTH using REXX program) and to narrow down the list if the SQL statement has "Group by" or "Order by" clause. I would like to know if we can get this information from any System table or If I can use any utility and expand the DBRMLIB to search for these keywords rather than going for a entire program search.

Regards,
Kalisgox
kalisgox
 
Posts: 1
Joined: Mon Aug 04, 2014 10:55 am
Has thanked: 1 time
Been thanked: 0 time

Re: Any Utility to expand DB2 SQL statements in DBRMLIB?

Postby Gandosio » Mon Sep 01, 2014 6:45 pm

Hi, we use the following select to extract the number of a particular statement on the sysibm.syspackstmt. I think you can modify it for finding the information you want...

Since the post is old probably you have already found the solution...if not i hope it helps you...

SELECT NAME,STMTNO, SECTNO, 1,
SEQNO,
SUBSTR(CAST(STMT AS VARCHAR(3500) FOR SBCS DATA) , 1, 51)
FROM SYSIBM.SYSPACKSTMT
WHERE LOCATION= ' '
AND COLLID LIKE 'MYCOLLID'
AND NAME IN ('MYPACKAGE', ' ')
AND SECTNO > 0
AND STMT LIKE '%WHAT I WANT TO FIND%'

These users thanked the author Gandosio for the post:
kalisgox (Fri Sep 05, 2014 3:56 pm)
Gandosio
 
Posts: 12
Joined: Tue Dec 21, 2010 3:47 pm
Has thanked: 0 time
Been thanked: 2 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post