Re: [GENERAL] plpgsql cursor reuse

2012-11-12 Thread salah jubeh
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

Re: [GENERAL] plpgsql cursor reuse

2012-11-12 Thread David Johnston
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

[GENERAL] plpgsql cursor reuse

2012-11-12 Thread David Greco
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

[GENERAL] plpgsql cursor syntax question

2010-08-30 Thread Mark Rostron
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

Re: [GENERAL] plpgsql/cursor

2001-09-17 Thread Jan Wieck
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

Re: [GENERAL] plpgsql/cursor

2001-09-14 Thread cnliou
> 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 --