Re: DECLARE CURSOR

From: "Matthew V(dot)" < <deusmech(at)yahoo(dot)com>>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: DECLARE CURSOR
Date: 2002-11-18 02:27:41
Message-ID: xeYB9.7364$We5.3971@nwrddc04.gnilink.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Sun, 17 Nov 2002 06:06:05 -0600, snpe wrote:

> On Sunday 17 November 2002 05:46 am, Frank Miles wrote:
>> On Sat, 16 Nov 2002, snpe wrote:
>> > On Saturday 16 November 2002 09:29 pm, Frank Miles wrote:
>> > > On Fri, 15 Nov 2002, snpe wrote:
>> > > > Hello,
>> > > > When I call DECLARE CURSOR out of transaction command success,
>> > > > but cursor is not created
>> > > > Reference manual say that this get error :
>> > > > ERROR: DECLARE CURSOR may only be used in begin/end transaction
>> > > > blocks I don't find this text in pgsql source code What is
>> > > > problem ?
>> > >
>> > > According to the documentation for DECLARE CURSOR (v.7.2.x):
>> > >
>> > > "Cursors are only available in transactions. Use to BEGIN, COMMIT
>> > > and
>> > > ROLLBACK to define a transaction block."
>> > >
>> > > This seems consistent with your error message. Please try wrapping
>> > > your DECLARE inside a transaction using BEGIN,...
>> >
>> > I understand it.
>> > I don't understand why 'DECLARE CURSOR' success out of a transaction
>> > - I expect error
>>
>> What version are you using? At least with 7.2.x, there is an immediate
>> error at the DECLARE statement. Perhaps I am misunderstanding your
>> question?
>>
>>
> 7.3b5
> maybe, it is prepare for cursor out of a transaction (I hope)
>
>

I'm getting a little confused, here, reading this. I don't have a BEGIN,
COMMIT, or ROLLBACK in sight in my ESQL application, but my cursor works
just fine. Under which circumstances are the BEGIN, COMMIT, and ROLLBACK
required? Is that something specific to the C interface?

--
Matthew Vanecek
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
********************************************************************************
For 93 million miles, there is nothing between the sun and my shadow except me.
I'm always getting in the way of something...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2002-11-18 04:39:24 Re: tree ordering with varbit
Previous Message Scott Lamb 2002-11-18 01:30:42 tree ordering with varbit

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2002-11-18 02:31:42 Re: CLUSTER ALL syntax
Previous Message Christopher Kings-Lynne 2002-11-18 01:53:07 Re: CLUSTER ALL syntax