Skip site navigation (1) Skip section navigation (2)

Can I create a function that returns many records?

From: "Joel Burton" <jburton(at)scw(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Can I create a function that returns many records?
Date: 2000-07-19 17:13:48
Message-ID: 3975A98C.26157.984840B@localhost (view raw or flat)
Thread:
Lists: pgsql-sql
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(at)scw(dot)org
Support Center of Washington (www.scw.org)

Responses

pgsql-sql by date

Next:From: Tom LaneDate: 2000-07-19 18:21:58
Subject: Re: Can I create a function that returns many records?
Previous:From: Patrick CoulombeDate: 2000-07-19 02:15:16
Subject: out-subject : thanks

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group