Re: dynamic OUT parameters?
| От | gherzig@fmed.uba.ar |
|---|---|
| Тема | Re: dynamic OUT parameters? |
| Дата | |
| Msg-id | cc04b2e14750ae30e53d1dfaeca50395.squirrel@www.webmail.fmed.uba.ar обсуждение исходный текст |
| Ответ на | Re: dynamic OUT parameters? (Craig Ringer <craig@postnewspapers.com.au>) |
| Ответы |
Re: dynamic OUT parameters?
|
| Список | 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 по дате отправления: