
Chapter 6. Custom Database Monitor Analysis 187
Example 6-7 shows a query with some of the most commonly used columns in the 3007
record.
Example 6-7 Common columns in the 3007 record
WITH xx AS
(SELECT * FROM mydbmon WHERE qqrid = 3007),
yy AS
SELECT qq1000 AS qqsttx, qqjfld, qqucnt
FROM mydbmon
WHERE qqrid = 1000
AND (qvc1c = 'Y' OR (qqc21 IN('DL', 'UP')
AND qqc181 <= ' ') OR qqc21 IN ('IN', 'IC', 'SK', 'SI') OR qqc21 LIKE 'O%'))
SELECT qq1000,
varchar(qqsttx,20000) AS "Statement Text"
FROM xx a LEFT JOIN yy b
ON a.qqjfld = b.qqjfld AND a.qqucnt = b.qqucnt
Figure 6-8 shows the result of the query in Example 6-7. This is an example with information ...