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'
"Postgres User" <[EMAIL PROTECTED]> writes:
> So I added the following code:
> ref_entry = 'c_entry';
> MOVE Backward All In c_entry;
You have to use EXECUTE for the latter.
regards, tom lane
---(end of broadcast)---
Thanks for the pointer. According to the Postgres docs:
"The portal name used for a cursor can be specified by the programmer
or automatically generated. To specify a portal name, simply assign a
string to the refcursor variable before opening it."
So I added the following code:
ref_entry
"Postgres User" <[EMAIL PROTECTED]> writes:
> Is there any way to 'rewind' the cursor to the first row?
plpgsql doesn't have any command for that (though I think someone is
working on improving its cursor command set). You should be able to
work around it by EXECUTE'ing a MOVE BACKWARD ALL comman
Hi,
I'm opening a refcursor in Postgres to return a dataset to the client.
However, before returning the cursor, I'd like to iterate thru the
rows. Here's the code:
DECLARE
ref_entry refcursor;
rec record;
i integer = 0;
v_list varchar = '';
BEGIN
OPEN ref_entry FOR