|
Hiya Tom,
Have you tried the debug option in iNav's Run SQL Scripts? It's under
"Run / Debugger".
Might be useful?
On 3/4/2013 4:37 PM, Thomas Garvey wrote:
I am having trouble debugging my external UDF which is called in an SQLnow.
statement. I'm pretty sure I've done this before but it's not working
Maybe someone can see what I'm doing wrong, or forgetting.opens
The UDF is an RPGLE module in a service program. I have a batch program
that 'prepares' a SQL statement from a string, and declares a cursor,
the cursor, and performs a fetch, as follows...from
SQLCommand = 'Select SpecFunct(char(numericfield), 'special literal')
library/file';needed
exec sql
prepare C1 from SQLCommand;
exec sql
declare D1 cursor for C1;
exec sql
open D1;
exec sql
fetch F1 into :Value;
if sqlcod = *zeros;
// do something
endif;
exec sql
close D1;
1. I start debug (STRDBG) on this program and issue an SBREAK on the
first line (SQLCommand =...)
2. I submit the call to the program, along with the library list
3. The batch job begins and the program is called and the break occurscommand
4. I copy the STRSRVJOB job info provided by the system and go to
another session (with the same library list) and paste the STRSRVJOB
5. I issue another STRDBG in that other session on the program andexecution
issue a break point at the same SQLCommand line of code.
6. I add the service program SpecFunct to the debugged programs and
issue a break point in that service program at the first line of
7. I press Enter on the first session to allow the program to continuestep
execution
Everything works as expected, the program stops and I step through the
original program logic, in the second session. However, I never get to
debug the service program. The system does call something because each
of the original program returns a zero in SQLCOD, AND it returns a value--
from the UDF. The problem is the value is wrong and I can't get to debug
the service program to find what is going wrong.
I know this is a lot of detail and I appreciate anyone's effort to wade
through it.
What am I missing?
Thanks much
Tom Garvey
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.