Skip site navigation (1) Skip section navigation (2)

Re: ECPG: using cursor returned from a stored function

From: "Gaetano Sferra" <gaesferr(at)libero(dot)it>
To: "pgsql-interfaces" <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: ECPG: using cursor returned from a stored function
Date: 2004-11-10 08:49:31
Message-ID: I6YGIJ$D4DB9EDFF9629DE909A569E6171B1FCE@libero.it (view raw or flat)
Thread:
Lists: pgsql-interfaces
> Cursors in ECPG are managed differently, so I strongly suspect that your idea 
> won't work.

I know how cursor work in ECPG to perform queries but I need to use a cursor
returned by a stored function, eg:

CREATE FUNCTION myfunction() RETURNS REFCURSOR AS'
BEGIN
DECLARE mycursor FOR SELECT * FROM mytable;
OPEN mycursor;
RETURN mycursor;
END;
'LANGUAGE 'plpgsql';

Now I need to retrieve the cursor returned by this function in an ECPG module to
use it in a C program.
How I can do it or it is impossible? If it is impossible cursors returned by a
stored funcion are only useful within a plpgsql context?
Please, I need an exaustive reply to proceed with my works.

Thank you,
Gaetano Sferra



____________________________________________________________
Libero ADSL: navighi gratis a 1.2 Mega, senza canone e costi di attivazione. 
Abbonati subito su http://www.libero.it 



pgsql-interfaces by date

Next:From: Gaetano SferraDate: 2004-11-10 14:22:43
Subject: Re: ecpg: using a cursor returned by a stored function
Previous:From: Gaetano SferraDate: 2004-11-10 08:38:16
Subject: Re: ecpg: using cursor returned from a stored function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group