Received: from olympus.scw.org (IDENT:root@209-9-156-98.sdsl.cais.net [209.9.156.98]) by hub.org (8.10.1/8.10.1) with ESMTP id e6JH9Ah22154 for ; Wed, 19 Jul 2000 13:09:11 -0400 (EDT) Received: from hades (hades.scw.org [209.9.156.99]) by olympus.scw.org (8.9.3/8.8.7) with ESMTP id NAA10618 for ; Wed, 19 Jul 2000 13:13:53 -0400 From: "Joel Burton" Organization: Support Center of Washington To: pgsql-sql@postgresql.org Date: Wed, 19 Jul 2000 13:13:48 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Can I create a function that returns many records? Message-ID: <3975A98C.26157.984840B@localhost> X-mailer: Pegasus Mail for Win32 (v3.12c) X-Archive-Number: 200007/182 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)