From: Joel Burton <jburton@scw.org>
To: pgsql-sql@postgresql.org
Subject: Can I create a function that returns many records?
Date: Wed, 19 Jul 2000 13:13:48 -0400
Message-ID: <3975A98C.26157.984840B@localhost> (raw)
I'd like to create a function that outs the results of a select query.
It might work like this:
SELECT METAPHONE('jennifer foobar');
persid | name
-----------------------------
1 | jennifer fubar
10 | gennifer foobar
[I already have the metaphone comparing working, it's the returning
the SELECt that needs help.]
Working through the documentation, I see examples using CREATE
FUNCTION METAPHONE(text) RETURNS setof tblPerson AS 'SELECT
* FROM tblPerson' LANGUAGE 'sql', but this returns only a single
numeric value (that doesn't seem to correspond to anything.)
Is there a way to do this? Any help would be very appreciated.
--
Joel Burton, Director of Information Systems -*- jburton@scw.org
Support Center of Washington (www.scw.org)
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: jburton@scw.org
Subject: Re: Can I create a function that returns many records?
In-Reply-To: <3975A98C.26157.984840B@localhost>
References: <3975A98C.26157.984840B@localhost>
* 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