DECLARING & OPENING SURSORS

From: Atif Jung <atifjung(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: DECLARING & OPENING SURSORS
Date: 2010-06-24 14:06:14
Message-ID: AANLkTilXgQoRj6nCVdO7yVkeJ1mYyKu5UilpHAFR_Fdl@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

In ECPG I've declared a cursor using the following code:

1294 EXEC SQL DECLARE t_cursor CURSOR WITH HOLD FOR SELECT col1 INTO
:h_col1 :h_col1_ind FROM table1;
1295 EXEC SQL WHENEVER SQLERROR STOP;

However when I OPEN the cursor using:

1296 EXEC SQL OPEN t_cursor;

I get an error stating :

current transaction is aborted, commands ignored until end of transaction
block on line 1296

According to the manual there seems to be nothing wrong with the OPEN
command. This is a bound cursor and for the life of me I can't see the
problem.

Thanks

Atif

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2010-06-24 14:26:17 Re: DROPPING INDEX error
Previous Message Atif Jung 2010-06-24 12:05:20 sqlca structure