|
I would venture to guess that you need to set the crtsqlrpgi compile time option on the called program to Close SQL cursor . . . . . . . . CLOSQLCSR *ENDACTGRP Or use C/EXEC SQL C+ Set Option C+ Naming = *Sys, C+ Commit = *None, C+ UsrPrf = *User, C+ DynUsrPrf = *User, C+ CloSqlCsr = *EndActGrp C/END-EXEC (Swiped From Rob) HTH Rick DuVall Systems Manager Dealer's Auto Auction of Okc 405 947-2886 Ext:143 rick@xxxxxxxxxx -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Krish Thirumalai Sent: Wednesday, May 11, 2005 1:59 PM To: RPG programming on the AS400 / iSeries Subject: SQL RPG and open cursors The idea is the calling pgm gets the variables that determine which cursor to use and passes them to the SQL pgm. On the first call for that set of parms the called pgm will determine which cursor to use, open it, and fetch the first row. On subsequent calls we pass a flag that lets the pgm know the variables haven't changed so we just want to fetch the next row. We only want to close the open cursor, run through the determination process, and open the new cursor if the rules from the calling pgm have changed. The problem is we are always getting an error on the second fetch from a cursor opened under a previous call. INLR is not on. Does anyone know a way around this or have you done something similar? Regards, -- Krish Thirumalai
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.