pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Allan Engelhardt <allane@cybaea.com>
To: pgsql-sql@postgresql.org
Subject: Re: how can i return multiple values from a function
Date: Thu, 04 Oct 2001 21:30:56 +0100
Message-ID: <3BBCC700.1AB0D51E@cybaea.com> (raw)
References: <111F528ABE61D511BD3C0050DA5CA0A2C5FC@JAGUAR>

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



view thread (2+ messages)

Message-ID: <3BBCC700.1AB0D51E@cybaea.com>
Permalink:  ../3BBCC700.1AB0D51E@cybaea.com/
Also on:    postgresql.org/message-id/3BBCC700.1AB0D51E@cybaea.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: allane@cybaea.com
  Subject: Re: how can i return multiple values from a function
  In-Reply-To: <3BBCC700.1AB0D51E@cybaea.com>

* 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