Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 087261337BA2 for ; Mon, 4 Oct 2010 18:20:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 33436-05 for ; Mon, 4 Oct 2010 21:20:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 2249B1337B4C for ; Mon, 4 Oct 2010 18:20:22 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 04 Oct 2010 16:20:23 -0500 Message-Id: <4CA9FEBE02000025000364B4@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Mon, 04 Oct 2010 16:20:14 -0500 From: "Kevin Grittner" To: ,"A J" Subject: Re: ECPG: AUTOCOMMIT and CURSORs References: <812668.19871.qm@web120007.mail.ne1.yahoo.com> In-Reply-To: <812668.19871.qm@web120007.mail.ne1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/27 X-Sequence-Number: 35768 A J wrote: > I am seeing some funny behavior on using both: > EXEC SQL SET AUTOCOMMIT TO ON; > and > CURSORS (EXEC SQL DECLARE ............., EXEC SQL FETCH NEXT FROM > .............) > > On autocommit on (either through above method or precompiling with > -t option), > the cursor does not return any rows. On disabling autocommit, I > get the required number of rows from the cursor. > > Any idea what could be going on ? Are you inside of a transaction? How does the WITH or WITHOUT HOLD function in ECPG? From the manual: http://www.postgresql.org/docs/current/interactive/sql-declare.html "WITHOUT HOLD specifies that the cursor cannot be used outside of the transaction that created it. If neither WITHOUT HOLD nor WITH HOLD is specified, WITHOUT HOLD is the default." -Kevin