Search Postgresql Archives

Re: How to create a function with multiple RefCursor OUT parameters

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

 



On Fri, May 16, 2008 at 2:17 AM, Albe Laurenz <laurenz.albe@xxxxxxxxxx> wrote:
> Chuck Bai wrote:
> CREATE OR REPLACE FUNCTION test_refcursor(INOUT tcount integer,
>   OUT o_user refcursor, OUT o_name refcursor) RETURNS record AS
> $BODY$
> BEGIN
>    o_user := 'o_user';
>    o_name := 'o_name';
>    tcount := tcount + 1;
>    OPEN o_user FOR SELECT * FROM user_table;
>    OPEN o_name FOR SELECT * FROM name_table;
> END;
> $BODY$
>  LANGUAGE 'plpgsql' VOLATILE

also don't forget, the refcursors are only valid for the duration of
the transaction.

merlin


[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