Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

sql stored procedure lets files opened

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

  • sql stored procedure lets files opened

    I call the procedure from a 5250 session (STRSQL, CALL TESTCLOSE).

  • #2
    sql stored procedure lets files opened

    Have you tried doing an explicit OPEN and CLOSE for TOPEN2? Dave

    Comment


    • #3
      sql stored procedure lets files opened

      Sorry, but i'm new with SQL stored procedure and I don't really understand what you mean. Is it possible to do an explicit OPEN or CLOSE in a procedure without using a cursor ?

      Comment


      • #4
        sql stored procedure lets files opened

        I normally close the file right after closing the cursor, I've had the same problem...
        Code

        Comment


        • #5
          sql stored procedure lets files opened

          I noticed that you have a line that reads: SET OPTION DBGVIEW = *SOURCE Is it possible to debug a stored procedure??? If so, how?

          Comment


          • #6
            sql stored procedure lets files opened

            Jerry, I'm not an expert on this by any means, but here's what I do know: 1. On the System i, SQL stored procedures are created as C programs. In fact, they are created as service programs. 2. You can set a Service Entry Point (SEP) on a service program. Putting these two together, it is theoretically possible that you could use WDSC to set an SEP on the service program for a stored procedure and debug it via WDSC. Again, I am far from an expert on this stuff, but it seems possible! Joe Joe

            Comment


            • #7
              sql stored procedure lets files opened

              Two articles on the archive. Part I & II http://www.mcpressonline.com/mc?1@17...ae.1@.214a2b35 http://www.mcpressonline.com/mc?1@17...ae.1@.214a2b35

              Comment


              • #8
                sql stored procedure lets files opened

                More info about my problem : I 've created the SQL stored procedure TESTCLOSE with Run sql script from ISeries Navigator. I call the procedure from the ISeries command line (session 5250)(not from RPG). After execution the file TOPEN2 is still open. DSPJOB option 14 Display open files, if active TOPEN2 LIBTFBCR TOPEN1 *ACTGRPDFN *DFTACTGRP 0000000000000002 If i call the SQL stored procedure from a CLLE compiled with activation group *NEW, TOPEN2 is closed after execution (the activation group closes the file after execution). I think that when the procedure is called from the command line, the file is not closed because it has been opened in the default activation group. In rpg, it 's possible to put an option to close the file : c/EXEC SQL c+ SET OPTION CLOSQLCSR = *ENDMOD c/END-EXEC but not in SQL ? Thanks for your help.

                Comment


                • #9
                  sql stored procedure lets files opened

                  I' ve a problem with this stored procedure sample. After execution, the file (TOPEN2) stays opened. If I remove the loop (WHILE), the file is closed after execution. Thanks for help, Bernard Crappe
                  Code

                  Comment


                  • #10
                    sql stored procedure lets files opened

                    The default of the RUNSQLSTM command is *ENDACTGRP, change the default to *ENDMOD. I think your problem will go away.
                    Code

                    Comment

                    Working...
                    X