Search Postgresql Archives

Re: returning ref cursor

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

 



On Mon, May 24, 2010 at 1:44 AM, Ravi Katkar <Ravi.Katkar@xxxxxxxxx> wrote:
> Please let me know what’s wrong with below code
> create or replace FUNCTION test_call()
>
> RETURNS VOID
>
>    AS $procedure$
>
>    DECLARE
>
>    c_cursor  REFCURSOR;

give your cursor a name:
c_cursor  REFCURSOR default 'a_name';

this name is also how you will use the refcursor from non-plpgsql
fetches later in the transaction if you needed to (in this case you
would likely return the cursor name from the function).

merlin

-- 
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