From: Kief Morris <k.morris@bitbull.com>
To: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Returning multiple rows in functions
Date: Mon, 6 Mar 2000 15:54:42 -0000
Message-ID: <30C64922AF42D311A96D00A0C91D0B107EB54D@mailpost.syzygy.net> (raw)
I'm missing something in the docs - how can I write a function
that returns multiple rows? I want to do the equivalent of:
select name from user_category where id = 21;
I create the following function:
create function getid (int4) returns text as 'select name from mytable
where id = $1;' language 'sql';
... but it only returns the first matching row. Is there
a way to return all the matching rows?
Thanks,
Kief
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: k.morris@bitbull.com
Subject: Re: Returning multiple rows in functions
In-Reply-To: <30C64922AF42D311A96D00A0C91D0B107EB54D@mailpost.syzygy.net>
References: <30C64922AF42D311A96D00A0C91D0B107EB54D@mailpost.syzygy.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox