From: A J <s5aly@yahoo.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: pgsql-admin@postgresql.org
Subject: Re: ECPG: AUTOCOMMIT and CURSORs
Date: Tue, 5 Oct 2010 10:51:18 -0700 (PDT)
Message-ID: <765296.62990.qm@web120013.mail.ne1.yahoo.com> (raw)
In-Reply-To: <4CA9FEBE02000025000364B4@gw.wicourts.gov>
References: <812668.19871.qm@web120007.mail.ne1.yahoo.com>
<4CA9FEBE02000025000364B4@gw.wicourts.gov>
That would explain it. I was neither in a transaction nor did any explicit HOLD.
Thanks Kevin.
________________________________
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: pgsql-admin@postgresql.org; A J <s5aly@yahoo.com>
Sent: Mon, October 4, 2010 5:20:14 PM
Subject: Re: [ADMIN] ECPG: AUTOCOMMIT and CURSORs
A J <s5aly@yahoo.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: s5aly@yahoo.com, Kevin.Grittner@wicourts.gov
Subject: Re: ECPG: AUTOCOMMIT and CURSORs
In-Reply-To: <765296.62990.qm@web120013.mail.ne1.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox