Hi there, new here and have question

From: "Hendra" <manusiatidakbiasa(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Hi there, new here and have question
Date: 2008-07-08 06:59:02
Message-ID: 48730fa2.1d078e0a.489c.ffffe00c@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Everyone.
I'm just subscribe to the mailing list
I'm new to Postgresql and
I have a question

I intend to make a function that returns more than a row
I tried something like below

create function listofemployeebasedondepartment(id_dept int) $$
declare
resultset ??;
begin
select * into resultset from employee where id_dept = id_dept;
return resultset;
end
$$ language 'plpgsql';

I believe you get what I want
But I just couldn't finish the code since I miss something
I manage to find 'setof' but have no idea on how to use it

Any suggestion everyone?

Thank you,
Regards,
Hendra

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dmitry Melekhov 2008-07-08 08:09:06 please explain vacuum with WAL
Previous Message Tino Wildenhain 2008-07-08 04:47:27 Re: To store and retrive image data in postgresql