From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
---|---|
To: | Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: PL/PGSQL: another Q |
Date: | 2003-01-17 07:13:04 |
Message-ID: | 20030116231219.N17630-100000@megazone23.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, 17 Jan 2003, Jean-Christian Imbeault wrote:
> I've gone through the books I have and searched the web but can't find
> an answer to this question.
>
> Is it possible to have a plpgsql function return a result set (rows)? If
> so what do I declare the return type as?
>
> I know it sounds silly but the reason would be that I have these
> extremely long queries that I hate typing. I'd love to just create a
> function, do a "SELECT myfunc(1,2,3,4,5,6,7)" and have the function spew
> out the result set (rows). So far I can only find example on how to get
> PL/PGSQL to return a single value.
>
> Can this be done in PL/PGSQL?
As of 7.3 it can be done reasonably. You might want to look at the
document on set returning functions that was just put up on techdocs.
From | Date | Subject | |
---|---|---|---|
Next Message | Patrick Fiche | 2003-01-17 08:03:10 | Re: PL/PGSQL: another Q |
Previous Message | Jean-Christian Imbeault | 2003-01-17 06:33:48 | PL/PGSQL: another Q |