Re: Fun with Cursors- how to rewind a cursor - Mailing list pgsql-general

From Postgres User
Subject Re: Fun with Cursors- how to rewind a cursor
Date
Msg-id b88c3460703012204p2c3b101ft8af105526aa0210d@mail.gmail.com
Whole thread Raw
In response to Re: Fun with Cursors- how to rewind a cursor  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I had tried several variations of MOVE Backward inside an Execute
statement earlier.  And now, I'm seeing this error appear again:

ERROR: 0A000: cannot manipulate cursors directly in PL/pgSQL

I updated the Postgres function below with this replacement line:
Execute 'MOVE Backward All In c_entry';

Any other thoughts?


On 3/1/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Postgres User" <postgres.developer@gmail.com> writes:
> > So I added the following code:
>
> > <before opening cursor>     ref_entry = 'c_entry';
> > <after looping thru cursor>  MOVE Backward All In c_entry;
>
> You have to use EXECUTE for the latter.
>
>                        regards, tom lane
>

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fun with Cursors- how to rewind a cursor
Next
From: "Postgres User"
Date:
Subject: Re: Add items to a record variable