plpgsql/cursor

Started by augieover 24 years ago3 messagesgeneral
Jump to latest
#1augie
augie@bravurasystems.com

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.

thanks

greg

#2cn
cnliou@eurosport.com
In reply to: augie (#1)
Re: plpgsql/cursor

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

--------------------------------------------------------
You too can have your own email address from Eurosport.
http://www.eurosport.com

#3Jan Wieck
JanWieck@Yahoo.com
In reply to: augie (#1)
Re: plpgsql/cursor

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 be finally released yet.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com