On 02-Mar-2016 11:20 -0600, Steve Richter wrote:
> Using the STRDBG and DSPMODSRC debug commands to debug an SQL
> function. Where the SQL function field names are not recognized by
> the EVAL command because the debugger is debugging the ILE C program
> that the SQL function was compiled as.
>
> So I use EVAL %localvars to see the actual names of the variables.
>
> Then to see the value of a character field named CH10 I run this
> [debugger] command:
>
> EVAL SQLP_L2.CH10:x 10
> 00000 F2F0F1F4 60F1F260 F0F1.... ........ - 2014-12-01......
>
> which is OK. But is there an easier way?
>
> <<SNIP>>
When using the green-screen debugger, in place of [to replicate] what
is shown being done in the above example, but without having to prefix a
variable name with the actual label, use the following debug command
wherein the SQL-generated label [previously specified as a prefix
including a period] has been replaced by two consecutive percent-signs
as prefix to the variable name:
EVAL %%CH10:X 10
For details, see:
[
http://www.mcpressonline.com/sql/techtip-enhanced-debug-experience-for-sql-routines-in-ibm-i.html]
TechTip: Enhanced Debug Experience for SQL Routines in IBM i
Written by Kent Milligan
Friday, 05 December 2014 01:00
"...
Clearly, the old EVAL support was cumbersome. With the recent
enhancements, a developer just needs to enter EVAL %%V1. This
improvement eliminates the need for a developer to create, find, or
enter a label-name! (If you're already in the practice of adding labels
and using those labels in the EVAL command, [then] that approach will
still work.)
Accessing these enhancements for the green-screen debugger is as simple
as loading the Database Group PTF level 32 for the 7.1 release and level
3 for the 7.2 release. ...
..."
Otherwise, as already noted elsewhere, the "no-charge IBM i graphical
debugger" should be an alternative. As well, there is the IBM® Data
Studio graphical debugger. Some more links included below; and the
"white paper" in the prior link, I believe means to reference the first
of the following links:
[
https://www.ibm.com/partnerworld/wps/servlet/ContentHandler/stg_ast_sys-wp-graphical-debugging]
Graphical debugging makes procedural SQL debugging on IBM i even easier
"Overview: This white paper ..."
[
http://www.ibm.com/developerworks/ibmi/library/i-debugger-db2-i/]
IBM Data Studio debugger and IBM DB2 for i
Graphically debug your SQL stored procedures and functions
--
Regards, Chuck