I don't have a command line in front of me right now, but I believe there is a compile option that officially determines when SQL cursors get closed in a module. Do a 14/15 on the program source and scroll down until you see this. Chris
I don't have a command line in front of me right now, but I believe there is a compile option that officially determines when SQL cursors get closed in a module. Do a 14/15 on the program source and scroll down until you see this. Chris
I think I know what you are talking about. The parameter is CLOSQLCSR and the values I believe are *ENDACTGRP, and *ENDMOD. The default is *ENDACTGRP. I recompiled my program with *ENDMOD, and it seem to help. I want to make sure there wasn't something else I needed to do as well.
Such as: C/EXEC SQL C+ SET OPTION CLOSQLCSR = *ENDMOD C/END-EXEC Using this statement prevents having to remember to do this at compile time.
I have an SQLRPGLE program with modules, that when the program is ended there are files that are still being left open. I know this because I did WRKACTJOB, and took option #14 work with open files. I checked my program, and It appears that all of my SQL cursors are being closed. I believe that when the program is called again, these files are being updated in error. Could this be causing my problem? If so, how do I fix it?
Thanks for the tip. I have couple of questions though. Where do you specify the SET OPTION CLOSQLCSR = *ENDMOD in relation to the other SQL commands? Does it come before you open the cursor, or after? Thanks.