pgsql-general@postgresql.org"
Sent: Monday, November 12, 2012 9:34 PM
Subject: [GENERAL] plpgsql cursor reuse
Came across this problem when trying to assign to a variable a field from a
record that could come from multiple cursors. PG throws an error – “
ERROR: type of parameter 7 (bigint
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of David Greco
Sent: Monday, November 12, 2012 3:35 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] plpgsql cursor reuse
Came across this problem when trying to assign to a variable a field
Came across this problem when trying to assign to a variable a field from a
record that could come from multiple cursors. PG throws an error - "
ERROR: type of parameter 7 (bigint) does not match that when preparing the
plan (unknown)". If I make the null column in c1 null::bigint to match curso
Ok guys - there is something here that I am not seeing Can someone please
set me straight.
I am trying to create a cursor loop with an "update where current of "
statement, but my syntax is wrong.
Would one of you be able to tell me what I'm doing.
Also: adding "for update" to the curs1 curs
augie wrote:
> can i declare and fetch from a cursor inside a plpgsql function? (pg
> version 7.0.3)
>
> if so, what would the syntax look like? i continue to get parse errors on
> 'cursor' in a very, very simple test.
Refernce cursors will occur in PostgreSQL v7.2. Not sure when
it'll
> can i declare and fetch from a cursor inside a
plpgsql function? (pg version 7.0.3)
In 7.1, the pl/pgsql document says you can code like
this:
DECLARE
rec record;
BEGIN
for rec in SELECT * from MyTable LOOP
update tableX set tableX=rec.fieldA;
END LOOP;
END;
CN
--