Passing RECORD variable from func1() to func2()

From: "Henry Combrinck" <henry(at)metroweb(dot)co(dot)za>
To: pgsql-general(at)postgresql(dot)org
Subject: Passing RECORD variable from func1() to func2()
Date: 2004-09-06 18:07:01
Message-ID: 51220.165.165.166.163.1094494021.squirrel@airmail.metroweb.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

Hopefully someone can shed some light on the following issue. After
chatting at irc.freenode.net/#postgresql, without success, this is my last
effort before giving up and using a temp table.

Essentially, I would like to pass a RECORD variable from one function to
another using plpgsql:

func2(record)
rec1 alias for $1
begin
-- do work on rec1.*
raise notice ''val1=% val2=%'', rec1.col1, rec1.col2;
end;

func1()
declare
temprec record;
begin
for temprec in select * from table1, table2...
loop
...
select func2(temprec); /* pass temprec row to func2() */
...
end loop;
end;

Then call with:
SELECT FUNC1();

Is this possible? The docs only speak about RECORD type being used to
*return* rows, but not to pass it.

Any pointers would be appreciated.

Regards
Henry

--------------------------------------------------------
This message was sent using MetroWEB's AirMail service.
http://www.metroweb.co.za/ - full access for only R73.
Free Web Accelerator, WebMail, Calendar, Anti-Virus,
Anti-Spam, 10 emails, 100MB personal webspace, and more!
Phone Now! 086 11 11 440

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Secrétariat 2004-09-06 18:09:39 PL-PGSQL language
Previous Message Joshua D. Drake 2004-09-06 17:22:12 Re: RAD with postgreSQL