× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 18-Apr-2017 07:17 -0500, Rob Berendt wrote:
Someone figure out a way to tie these two queries together:

SELECT X.JOB_NAME
FROM TABLE(QSYS2.JOB_INFO(JOB_STATUS_FILTER => '*JOBQ',
JOB_USER_FILTER => '*ALL')) X
WHERE JOB_QUEUE_LIBRARY = 'ERPLXEC'
AND JOB_QUEUE_NAME = 'BPCSJOBQ'

SELECT Y.MESSAGE_ID, Y.MESSAGE_TEXT
FROM TABLE(QSYS2.JOBLOG_INFO('017044/DARREN/CST601J')) Y
WHERE Y.MESSAGE_TEXT LIKE '%ERPCSTROL1DARREN%'

You need to pass x.job_name from the first query into where you see
'017044/DARREN/CST601J'

[…]


Untested, but the [implied per TABLE keyword] LATERAL join should suffice to enable referring to X.JOB_NAME in the second of the subqueries:

SELECT X.JOB_NAME, Z.*
FROM TABLE(QSYS2.JOB_INFO( JOB_STATUS_FILTER => '*JOBQ'
, JOB_USER_FILTER => '*ALL')) as X
CROSS JOIN TABLE
( SELECT Y.MESSAGE_ID, Y.MESSAGE_TEXT
FROM TABLE(QSYS2.JOBLOG_INFO( X.JOB_NAME )) as Y
WHERE Y.MESSAGE_TEXT LIKE '%ERPCSTROL1DARREN%' ) as Z
WHERE JOB_QUEUE_LIBRARY = 'ERPLXEC'
AND JOB_QUEUE_NAME = 'BPCSJOBQ'

Or similarly [now referencing A.JOB_NAME]:

SELECT A.JOB_NAME, Z.*
FROM TABLE
( SELECT X.JOB_NAME
FROM TABLE QSYS2.JOB_INFO( JOB_STATUS_FILTER => '*JOBQ'
, JOB_USER_FILTER => '*ALL')) as X
WHERE JOB_QUEUE_LIBRARY = 'ERPLXEC'
AND JOB_QUEUE_NAME = 'BPCSJOBQ'
) as A
CROSS JOIN TABLE
( SELECT Y.MESSAGE_ID, Y.MESSAGE_TEXT
FROM TABLE(QSYS2.JOBLOG_INFO( A.JOB_NAME )) as Y
WHERE Y.MESSAGE_TEXT LIKE '%ERPCSTROL1DARREN%'
) as Z


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.