Re: Re: function with multi-values

From: Harry Yau <harry(dot)yau(at)regaltronic(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: function with multi-values
Date: 2001-05-02 02:10:36
Message-ID: 3AEF6C9C.4A6B9FE0@regaltronic.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>On Sat, Apr 28, 2001 at 09:46:44AM +0800, Harry Yau wrote:
>> Dear:
>> I wanna create a function that return a multiple rows in to a
single
>>
>> row.
>> example:
>> CREATE FUNCTION GETNAME() RETURNS SETOF VARCHAR AS 'SELECT NAME FROM
>> TEST;' LANGUAGE 'SQL';
>>
>> when i call this function it return:
>> ----------
>> peter
>> susan
>> john
>>
>> but I wonder is it possible to make it to return something like
>> ---------------------
>> peter susan john
>>
>> I have to use this result to print in quick report.
>> THANK YOU VERY MUCH
>
>Maybe you want your function to iterate through the records and return
a
>string of concatenated results? Or does it need to be a tuple? To do
>so, I think you'd need to use pgplsql.

I think is will be ok for the first method, but I am not really familiar
with pgplsql.
I am wondering is there any complete referrence for pgplsql online.
Thank You

Harry Yau

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-05-02 04:28:29 Re: Multicolumn index - is there a limit?
Previous Message Joseph Shraibman 2001-05-02 01:47:15 Timestamp bug WAS: Problem with restore on upgrading to 7.1