Loop plpgsql recordset

From: "Furesz Peter" <fureszpeter(at)srv(dot)hu>
To: "postgres levlista" <pgsql-general(at)postgresql(dot)org>
Subject: Loop plpgsql recordset
Date: 2007-01-25 19:46:39
Message-ID: 003501c740b9$8814a410$6500a8c0@bixerverintel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

How can I loop a PL/PgSQL recorset variable? The example:

DECLARE
v_tmp_regi RECORD;
v_tmp RECORD;
BEGIN
SELECT * INTO v_tmp_regi FROM sulyozas_futamido sf WHERE
sf.termekfajta_id=
a_termekfajta_id AND sf.marka_id=a_marka_id;

DELETE FROM sulyozas_futamido;

FOR v_tmp IN v_tmp_regi LOOP
--I would like to work here with the old recordset!
END LOOP;
^^^^^^^^^^^^^^
-- This is not working !!!

END;

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Furesz Peter 2007-01-25 19:47:28 loop plpgsql recordset variable
Previous Message Tommy Gildseth 2007-01-25 19:37:30 Re: Problem with result ordering