From: | Allan Engelhardt <allane(at)cybaea(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: how can i return multiple values from a function |
Date: | 2001-10-04 20:30:56 |
Message-ID: | 3BBCC700.1AB0D51E@cybaea.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
From | Date | Subject | |
---|---|---|---|
Next Message | Allan Engelhardt | 2001-10-04 20:33:02 | Re: Function return rows? |
Previous Message | jason.servetar | 2001-10-04 19:59:24 | Re: to_date/to timestamp going to BC |