Search Postgresql Archives

Re: Passing refcursors between pl/pgsql functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
> What I would like is something like the following, assuming it's possible:
>
> CREATE OR REPLACE FUNCTION fetch_from_refcursor(ref refcursor) RETURNS
> SETOF test_table AS $$
> BEGIN
> ÂRETURN FETCH 1 FROM ref; -- Does not work, but can it?
> END $$ language plpgsql;
>
> Is it possible to do such a thing? ÂI have a feeling that it isn't, but
> I'd love to be proven wrong.

Hello, there isn't any available statement for transformation from
cursor to table. You have to iterate over FETCH statement and to use a
RETURN NEXT statement.

Regards

Pavel Stehule

>
> Thanks in advance,
>
> Reuven
>
> --
> Reuven M. Lerner -- Web development, consulting, and training
> Mobile: +972-54-496-8405 * US phone: 847-230-9795
> Skype/AIM: reuvenlerner
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux