Have you already looked for the statement in the SQL Plan cache (System I
Navigator > Databases > SQL Plan Cache ?
Right click Plan Cache and select Show Statements
Pick a time (Statements that ran on/after this ...) and click Refresh to
show all statements
It should be there
Right click and do Visual Explain
In Vis Explain panel, Options>Advisor to see if indexes advised..
(I personally never let the tool build the indexes - only because no DB
Manager and we are still in a DDS based database...)
hth
Jim
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jeff
Young
Sent: Thursday, November 17, 2016 11:59 AM
To: midrange-l@xxxxxxxxxxxx
Subject: Show last SQL statement used in a job
If I recall correctly from a long time ago (and far far away), there was a
method to show the last sql statement a running job executed.
Does anyone recall how to do this?
Thanks.
BTW, I am attempting to troubleshoot an SQL RPGLE program that is taking an
unusually long time to return results. The program is dynamically preparing
a cursor based on input from a user program. Is there any easy way to
analyze that statement to determine if there is a better way to optimize it?
Jeff Young
Sr. Programmer Analyst
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
As an Amazon Associate we earn from qualifying purchases.