ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Easiest fastest way to debug an SQL UDF (preferably from green screen)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Easiest fastest way to debug an SQL UDF (preferably from green screen)

    What is the easiest fastest way? What is any way?
    Seems I've tried everything.

    thank you

  • #2
    From Green Screen you can only debug the generated C code (STRDBG then STRSQL and run your UDF).
    A better way is to use the graphical debugger included in the RUN SQL SCRIPT tools integrated in Client Access or better Access Client Solution (ACS).

    Open RUN SQL SCRIPT --> RUN --> System Debugger --> Select your Program or Service Program (UDFs are Service Programs). You need the system name for the program or service program, not the function name.
    Set a single or mutliple break points.
    Run your UDF and debugg.

    For debugging the SQL code, you need to include SET OPTION DbgView = *Source (Before the first Begin/End Block) in your source code

    Birgitta

    Comment


    • #3
      Once again,thanks Birgitta.

      Comment


      • #4
        You are wellcome

        Comment


        • #5
          Originally posted by B.Hauser View Post
          From Green Screen you can only debug the generated C code (STRDBG then STRSQL and run your UDF).
          A better way is to use the graphical debugger included in the RUN SQL SCRIPT tools integrated in Client Access or better Access Client Solution (ACS).

          Open RUN SQL SCRIPT --> RUN --> System Debugger --> Select your Program or Service Program (UDFs are Service Programs). You need the system name for the program or service program, not the function name.
          Set a single or mutliple break points.
          Run your UDF and debugg.

          For debugging the SQL code, you need to include SET OPTION DbgView = *Source (Before the first Begin/End Block) in your source code

          Birgitta
          I finally got back into this.
          From the debugger i started it up and i see programs, service programs, and class files. However i am unable to click anything to invoke some action to allow me to choose the udf.
          I am connected to the system and able to do sql scripts no problem.
          any ideas?

          Comment


          • #6
            In case some additional detail is needed or just different wording, you might try following Kent Milligan's write-up: Graphical debugging makes procedural SQL debugging on IBM i even easier (.PDF).

            I've used it in that form, but I most often use the standalone System i5 Graphical Debugger. I first used it on WinXP, but I use it on Linux... especially since I'm not yet able to use iNav on Linux. Either way, it can take some practice, especially getting the right options set at the start of a debug session.
            Tom

            There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

            Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

            Comment

            Working...
            X