On Wednesday 04 Dec 2002 6:48 am, Madhavi wrote:
> Hi all,
> I'm executing dynamic queries in postgres7.2.3. Is there a way I can
> execute a refcursor and then select it into a variable and then return that
> variable? My query returns the sum of values. So its only one single
> value...that I want to select into a variable. How do I do this. 'cos I
> don't wnat to return a refcursor.
Not sure that you need a refcursor at all for what you're describing. Define
the function as returning int4 (or whatever numeric type is desired) and
either SELECT INTO, or use a LOOP on the refcursor if that's what you need.
--
Richard Huxton