Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f94KYYn66746 for ; Thu, 4 Oct 2001 16:34:34 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f94KX3776546 for pgsql-sql@postgresql.org; Thu, 4 Oct 2001 16:33:03 -0400 (EDT) (envelope-from news) From: Allan Engelhardt X-Newsgroups: comp.databases.postgresql.sql Subject: Re: how can i return multiple values from a function Date: Thu, 04 Oct 2001 21:30:56 +0100 Organization: http://cybaea.com/ Message-ID: <3BBCC700.1AB0D51E@cybaea.com> References: <111F528ABE61D511BD3C0050DA5CA0A2C5FC@JAGUAR> X-NNTP-Posting-Host: engelhardt.demon.co.uk:193.237.12.86 X-Complaints-To: abuse@demon.net X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.7 i686) X-Accept-Language: en MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Lines: 18 To: pgsql-sql@postgresql.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by postgresql.org id f94KYYn66747 X-Archive-Number: 200110/65 X-Sequence-Number: 5020 Try using temporary tables. Functions can't return tables and, it would seem, SETOFs. srinivas wrote: > i have tried retrieving multiple values using setof function but i > couldnt solve it.when i am trying using setof iam getting this as > output. > > > 1 CREATE FUNCTION hobbies (varchar) RETURNS SETOF bank > 2 AS 'SELECT * FROM bank > 3 ' > 4 LANGUAGE 'sql'; > > ~ > output: > select hobbies('srinivas') as col; > col > ----------- > 137462096 > 137462096 > (2 rows) > > please let me know what is the alternative and if possible with a sample > piece of code. > > cheers > chowdary. > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly