Re: can plpgsql returns more flexibe value ?

From: Kris Jurka <books(at)ejurka(dot)com>
To: "Arnold(dot)Zhu" <joint(at)shaucon(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: can plpgsql returns more flexibe value ?
Date: 2005-01-22 03:24:00
Message-ID: Pine.BSO.4.56.0501212222280.32765@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 22 Jan 2005, Arnold.Zhu wrote:

> >Yeah, you just make your function return 'SETOF record' and specify the
> >types when you do the select:
> >
> >select * from func() as (a int, b text);
> >
>
> This is not a good idea when I use C# to program, I want to Fill the resultset
> directly into Dataset, this method will should use more sql to get data,
> it lose function's convenience like stored procedure.
>

Perhaps you should look into the refcursor type, which will allow you to
return anything you want without specifying it. You can't do things like
a join between to refcursor outputs, but it does allow for more return
flexibility.

Kris Jurka

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-01-22 04:34:06 Re: ARC patent
Previous Message Arnold.Zhu 2005-01-22 01:53:37 Re: can plpgsql returns more flexibe value ?