+ Reply to Thread
Results 1 to 5 of 5

Thread: SQL files still being left open

  1. #1
    Guest.Visitor Guest

    Default SQL files still being left open

    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

  2. #2

    Default SQL files still being left open

    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.

  3. #3
    Guest.Visitor Guest

    Default SQL files still being left open

    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.

  4. #4

    Default SQL files still being left open

    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?

  5. #5

    Default SQL files still being left open

    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.

+ Reply to Thread

Similar Threads

  1. Open query files with DDM files......
    By Guest.Visitor in forum General
    Replies: 1
    Last Post: 04-04-2006, 11:16 AM
  2. Tables left open
    By bibarnes@yahoo.com in forum SQL
    Replies: 0
    Last Post: 09-15-2005, 06:47 AM
  3. RPG embedded SQL file left open after program ends
    By Guest.Visitor in forum General
    Replies: 1
    Last Post: 09-04-2003, 01:18 PM
  4. Files left open
    By chuck.nordin@hmhpub.com in forum Programming
    Replies: 1
    Last Post: 06-05-2001, 12:31 PM
  5. Display Open Files
    By Guest.Visitor in forum Analysis
    Replies: 1
    Last Post: 06-30-1998, 07:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts