function that return multiple fields and rows - Mailing list pgsql-general

From Wooi K
Subject function that return multiple fields and rows
Date
Msg-id 00121105462400.22067@kobeta.halfmind.com
Whole thread Raw
Responses Re: function that return multiple fields and rows
List pgsql-general
Hi All,
    I would like to write a function that returns multiple rows and multiple
fields, something like this.  I know the syntax is probably wrong, any helps
would be appreciated.

CREATE FUNCTION GetGuestbookMessages (int4) RETURNS SETOF VARCHAR AS
'
        SELECT guestname, guestemail FROM GuestbookMessages WHERE UserId = $1
' LANGUAGE 'sql';

notice that I want to return more than one field and more than one record in
the above function.  Thanks.

wooi.

pgsql-general by date:

Previous
From: GH
Date:
Subject: Re: What's faster: value of 0 or NULL with index
Next
From: Tomas Berndtsson
Date:
Subject: Re: Simple Question: Case sensitivity