|
I do specifically close the cursor in the sqlrpgle. Early on (97-98') had problems if multiple users at same time, and read somewhere the close cursor compile option was the work a round. Have done it ever since but also use compile option. Default on rpgle is endactgrp. btw- after a lot more digging last nite, i really did have sqlcode & state associated with huge job log. It was the close cursor in program after the search string failed on select statement (i had not coded for user entering a single quote in a search name). jim ----- Original Message ----- From: "Haas, Matt" <Matt.Haas@xxxxxxxxxxx> To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx> Sent: Thursday, March 25, 2004 8:39 AM Subject: RE: SQL RPGLE CLOSQLCSR > Jim, > > You'll be much better off explicitly closing your cursors than relying on the OS to do it for you. For my CGI's, I just take the default which I think is *ENDACTGRP. > > Matt > > -----Original Message----- > From: Jim Franz [mailto:jfranz@xxxxxxxxxxxx] > Sent: Wednesday, March 24, 2004 10:40 PM > To: RPG programming on the AS400 / iSeries > Subject: SQL RPGLE CLOSQLCSR > > > I have a 50,000 page joblog from a sqlrpgle program called > from rpg cgi programs, all related to a single call. > The pgm was compiled to close cursor *endactgrp. > This program gets called hundreds or thousands of times a day. Every few > days I find another 50,000 page joblog, related to a single call. > The sql select statement executed fine with no error code. > The msg below mentions closqlcsr(*endsql) which is not listed as an option > on the v4r5 sqlrpgle compile cmd. Last cume & database group applied for > v4r5. > How should the closqlcsr option be coded for web apps? > tia > jim > > MSGID TYPE SEV DATE TIME FROM PGM > LIBRARY INST TO PGM LIBRAR > SQL0501 Diagnostic 30 03/23/04 09:49:26 QSQLCLS > QSYS 033E QSQLCLS QSYS > Message . . . . : Cursor C1 not open. > Cause . . . . . : The cursor C1 was > specified in a FETCH or CLOSE statement, > but the cursor is not open. Cursor C1 > has one of the following conditions: > -- Cursor C1 was never opened. -- The > cursor C1 was opened in another > program or another call of this > program and the program was created with > CLOSQLCSR(*ENDPGM). -- The cursor C1 > was opened in another module or another > call of this module and the module > was created with CLOSQLCSR(*ENDMOD). -- > The cursor C1 was opened in another > call of this program and programs which > have run SQL statements have ended > and the program was created with > CLOSQLCSR(*ENDSQL). -- The cursor C1 > was opened in another call of this > module and the activation group ended > between calls. The module was created > with CLOSQLCSR(*ENDACTGRP). -- The > cursor was closed by a CLOSE, COMMIT, or > ROLLBACK statement. Recovery . . . : > Do one of the following and > precompile again: -- Make certain > that cursor C1 is opened in the same > program or module call prior to using > the cursor in an FETCH or CLOSE > statement. -- Specify either > CLOSQLCSR(*ENDSQL), CLOSQLCSR(*ENDJOB), or > CLOSQLCSR(*ENDACTGRP) when > precompiling the application. -- If the cursor > was closed by a COMMIT or ROLLBACK, > specify HOLD on the COMMIT or ROLLBACK > statement to preserve any open > cursors, prepared statements, and locks on > tables. > > > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.