Re: RETURN SET OF DATA WITH CURSOR

From: Richard Huxton <dev(at)archonet(dot)com>
To: grupos <grupos(at)carvalhaes(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: RETURN SET OF DATA WITH CURSOR
Date: 2005-12-15 16:03:00
Message-ID: 43A193B4.5070206@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

grupos wrote:
> Hi !
>
> I am making one plpgsql function and I need to return of setof data
> using a cursor.
>
> The problem is that my function is returning only the first row and
> column of the query. This query have more than 80 columns and 1.000
> rows. Enyone have any tip to give me?

Yes - decide whether you are returning a set of rows or a refcursor.

Check the plpgsql docs again for how to return SETOF <rowtype> using the
RETURN NEXT statement. Then you call your function like: SELECT * FROM
my_func();

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message grupos 2005-12-15 16:58:05 Re: RETURN SET OF DATA WITH CURSOR
Previous Message Gianluca Riccardi 2005-12-15 15:35:34 Re: selective updates