From: Richard Huxton <dev@archonet.com>
To: grupos <grupos@carvalhaes.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: RETURN SET OF DATA WITH CURSOR
Date: Thu, 15 Dec 2005 16:03:00 +0000
Message-ID: <43A193B4.5070206@archonet.com> (raw)
In-Reply-To: <43A18B25.1010705@carvalhaes.net>
References: <43A18B25.1010705@carvalhaes.net>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, grupos@carvalhaes.net
Subject: Re: RETURN SET OF DATA WITH CURSOR
In-Reply-To: <43A193B4.5070206@archonet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox