Re: plpgsql/cursor

From: <cnliou(at)eurosport(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: plpgsql/cursor
Date: 2001-09-15 00:59:33
Message-ID: 200109150059.21e6@lh00.opsion.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> 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

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2001-09-15 01:27:08 Re: Abort state on duplicated PKey in transactions
Previous Message cnliou 2001-09-15 00:54:58 Re: need help