dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
There is a statement number associated with the row,
this statement number refers to your db2 precompiler output.
alternatively,
you can go to the dbrm for your module
and search for the statement number (it is in binary)
this link is a REXX ISPF Macro that I wrote that will find the sql in your dbrm. |
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
via dsn_query_table & XML
Code: |
select
a."QUERYNO", a."COLLID", a.PROGNAME, a.EXPLAIN_TIME
,cast(xml2clob(xmlquery('$c/QUERY//text()' passing xmlparse(q.node_data) as "c")) as varchar(10000))
from
DSN_STATEMNT_TABLE A
, DSN_QUERY_TABLE Q
where a."COLLID" = ,
and a.EXPLAIN_TIME = q.EXPLAIN_TIME
and a."QUERYNO" = q."QUERYNO"
and q.QUERY_STAGE = 'BEFORE'
and q."TYPE" = 'SELECT' |
the other way is via syspackstmt;
stmt is in "for bit data , but most of it is readable unicode"
Code: |
select
a."QUERYNO", a."COLLID", a.PROGNAME, a.EXPLAIN_TIME
,p.version
,i.stmt
from DSN_STATEMNT_TABLE A
, plan_table P
, sysibm.syspackstmt I
where a."COLLID" = ?
and a."COLLID" = p."COLLID"
and a.PROGNAME = p.PROGNAME
and a.EXPLAIN_TIME = p.BIND_TIME
and I.LOCATION = ''
and i."COLLID" = p."COLLID"
and i.NAME = p.PROGNAME
and i."QUERYNO" = p."QUERYNO" |
|
|