Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Open Cursors

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

  • Open Cursors

    You are on the right track. As IBM support once told me..."There is open, and there is open". The cursor you "close" in your RPG code is not really closed until either that module or the activation group closes (depending on how you set the option during the compile). I strongly urge every programmer to set their default for this to *ENDMOD unless they have a good reason to do otherwise. Why IBM made the default *ENDACTGRP, when it clearly creates problems for everyone new to SQLRPGLE, is a mystery. The cursor names should not be a problem. Every user will have their own. Kevin

  • #2
    Open Cursors

    Thank you for the reply.

    Comment


    • #3
      Open Cursors

      Where is this at? I looked when I tried to compile and don't see the option? ANy help would be greatly appreciated.

      Comment


      • #4
        Open Cursors

        I am new to SQL in RPG. I had an error situation the other day that caused me to wonder about open cursors. My program in my test library bombed. When I tried to rerun it, I got thousands of pages of open cursor errors. When I switched libraries and tried to debug it, I never even got into the program before I got open cursor errors. 1. Am I correct in thinking that changing the compile feature Close SQL cursor from *ENDACTGRP to *ENDMOD will close my cursors if my program ends in error? 2. Also, is the cursor unique to each user, if I have multiple users of the same program? 3. If I use the same cursor name for the same file in multiple programs, are they unique to the program or does some other program think my cursor is open?

        Comment


        • #5
          Open Cursors

          >I strongly urge every programmer to set their default for this to *ENDMOD unless they have a good reason to do otherwise.
          NO!!! Closing the cursor at the end of the module does will decrease performance, because a full open (i.e. complete optimization) must be performed each time the module will be called again. And full opens are very expensive! In the following comment I explained why *ENDMOD never should be used: Reader Feedback on Using the SQL SET OPTION Statement http://www.itjungle.com/fhg/fhg032107-story02.html Birgitta

          Comment

          Working...
          X