Re: dynamic OUT parameters? - Mailing list pgsql-sql

From gherzig@fmed.uba.ar
Subject Re: dynamic OUT parameters?
Date
Msg-id cc04b2e14750ae30e53d1dfaeca50395.squirrel@www.webmail.fmed.uba.ar
Whole thread Raw
In response to Re: dynamic OUT parameters?  (Craig Ringer <craig@postnewspapers.com.au>)
Responses Re: dynamic OUT parameters?
List pgsql-sql
> gherzig@fmed.uba.ar wrote:
>
>> Oh, that looks promising. I wrongly supposed that RETURNING SETOF RECORD
>> forces the use of OUT parameters. I will give your idea a try.
>
> Tom Lane's point about using a refcursor is (unsurprisingly) a good one.
> If you return a refcursor from your function, you don't have to do any
> special work to call the function, and you can (with most DB access
> APIs) FETCH records from the cursor rather conveniently.
>
> See:
>
> http://www.postgresql.org/docs/8.3/static/plpgsql-cursors.html
>
> --
> Craig Ringer
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
Well, aparenty my problem remains, because the boss want that the
programmers just need to call
select * from report('table_name'). Following your previous sample
function, im forced to use it in the form
select * from report('table_name') as x(a int, b varchar, c int), and that
"as x(...)" is the kind of thing hes triyng to avoid. Same feeling about
fetching records at application level. To bad for me, im affraid :(

Gerardo




pgsql-sql by date:

Previous
From: Jasen Betts
Date:
Subject: Re: regexp_replace and UTF8
Next
From: Craig Ringer
Date:
Subject: Re: dynamic OUT parameters?