Re: Help trying to write my first plpgsql function...

From: hubert depesz lubaczewski <depesz(at)gmail(dot)com>
To: Bjørn T Johansen <btj(at)havleik(dot)no>
Cc: s(dot)gnanavel(at)gmail(dot)com, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Help trying to write my first plpgsql function...
Date: 2005-09-15 09:32:13
Message-ID: 9e4684ce050915023213c1bf2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/15/05, Bjørn T Johansen <btj(at)havleik(dot)no> wrote:
>
> But this function does not do what I need it to do... I want x rows
> returned, but
> instead I just get a stringname...
> Either how do I use this name or how do I return x rows?
>

for refcursors - just use returned name in subsequent "FETCH FROM
<this_name>";

for set returning functions you have to declare them as "returns set of
SOMETHING"
and then use return next SOMETHING;
insetead of return.

read the docs - it's quite good reading.

depesz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message nicolas.hafner 2005-09-15 09:54:14 Copy DataBases Server to server
Previous Message Bjørn T Johansen 2005-09-15 09:28:53 Re: Help trying to write my first plpgsql function...