|
I have my procedure like that and its work. --- start procedure-- DECLARE cursor1.... OPEN cursor1... FETCH cursor1 INTO... eval *in12='0' >>>>>>>>>>>SFLEND indicator SQLCOD DOUNE 0 IF sqlcod=0 WRTSFL RECNO IFEQ 9999 LEAVE ENDIF ENDIF ENDDO eval *in12='1' --- end procedure --- ------------------( Forwarded letter 1 follows )--------------------- Date: Fri, 7 Jun 2002 22:24:51 +0000 (UTC) To: rpg400-l@midrange.com From: tomh@simas.com Sender: rpg400-l-admin@midrange.com Reply-To: rpg400-l@midrange.com Subject: Trouble with SQLRPGLE CLOSE CURSOR I have an SQLRPGLE program. Within it are several sub-procedures which use SQL to populate subfile displays. These sub-procedures do their SQL processing like so: --- start procedure-- DECLARE cursor1.... OPEN cursor1... FETCH cursor1 INTO... IF sqlcod=0 DOW sqlcod=0 write subfile entry FETCH cursor1 INTO... ENDDO ENDIF CLOSE cursor1 --- end procedure --- The first time I go thru the sub-procedure everything is fine. Files are opened and closed as I expect, and can be verified with the 'WRKACTJOB, Open files' display. On subsequent passes thru the sub-procedures, the CLOSE cursor1 doesn't work and the file is left open, and SQLCOD = *zeros. Everything else is find, the program executes the SQL CLOSE statement (verified with STRDBG), but the file is left open. Am I overlooking something? _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com 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-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.