DECLARING & OPENING SURSORS - Mailing list pgsql-novice

From Atif Jung
Subject DECLARING & OPENING SURSORS
Date
Msg-id AANLkTilXgQoRj6nCVdO7yVkeJ1mYyKu5UilpHAFR_Fdl@mail.gmail.com
Whole thread Raw
List 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


pgsql-novice by date:

Previous
From: Atif Jung
Date:
Subject: sqlca structure
Next
From: Tom Lane
Date:
Subject: Re: DROPPING INDEX error