Re: ECPG: AUTOCOMMIT and CURSORs

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-admin(at)postgresql(dot)org>,"A J" <s5aly(at)yahoo(dot)com>
Subject: Re: ECPG: AUTOCOMMIT and CURSORs
Date: 2010-10-04 21:20:14
Message-ID: 4CA9FEBE02000025000364B4@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

A J <s5aly(at)yahoo(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2010-10-04 22:40:59 Re: Default session timeout in PG?
Previous Message A J 2010-10-04 19:07:05 ECPG: AUTOCOMMIT and CURSORs