× 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.



Looks like the CLOSQLCSR with *ENDMOD worked.
The *ENDPGM works with non-ILE programs.



----- Original Message -----

From: "Eric DeLong" <EDeLong@xxxxxxxxxxxxxxx>
To: "RPG programming on the IBM i (AS/400 and iSeries)" <rpg400-l@xxxxxxxxxxxx>
Sent: Thursday, December 26, 2013 11:04:44 AM
Subject: RE: SQL Closing Files

Hi Jay,

SQL has specific requirements on how cursors are managed. There are compiler options that control this, but I would recommend using an SQL SET OPTIONS statement to define this behavior. By embedding these option into source, you don't have to remember the magic mix of compile commands each time you build the program. The Options block is like the H-spec in that way... Here's one that's fairly standard (for me, anyway)...

EXEC SQL
Set Option
DatFmt=*Iso, Naming=*Sys, Commit=*None,
UsrPrf=*User, DynUsrPrf=*User, CloSqlCsr=*EndMod ;

Note the last option (CloSqlCsr)...

You need to search the online references (SQL Programming Reference) for details on this option. To mark a starting point, please be sure to review *ENDPGM as a possible solution. Please be aware that for CGI, you could adversely affect performance by changing these behaviors.

You should probably use PRTSQLINF command on your CGI program, so that you can see which SQL options were specified on your existing program. Review those options in the SQL reference to understand why your program was NOT closing cursors.

If you get stumped along the way, ask here and we'll help you understand.

Hth,
-Eric DeLong

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of tegger@xxxxxxxxxxx
Sent: Thursday, December 26, 2013 9:23 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: SQL Closing Files

I have a couple of programs that are RPG/CGI with embedded SQL using CGIDEV2 that are not closing files. The *INLR is on and each SQL block has the exec sql close statements. But the files are still being left open.

Anyone else seeing this??


Jay B
Delaware


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.