× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.