Reading from a REFCURSOR in a C language function

Started by Vlad Arkhipovalmost 15 years ago3 messages
#1Vlad Arkhipov
arhipov@dc.baikal.ru

Hi,

I'm trying to write a C language function that has a REFCURSOR argument.
Could anyone please give me an example of reading from a cursor in C code?

#2Jan Wieck
JanWieck@Yahoo.com
In reply to: Vlad Arkhipov (#1)
Re: Reading from a REFCURSOR in a C language function

On 4/5/2011 3:24 AM, Vlad Arkhipov wrote:

Hi,

I'm trying to write a C language function that has a REFCURSOR argument.
Could anyone please give me an example of reading from a cursor in C code?

Sorry, I don't have a code example.

A refcursor data type is basically a string, containing the name of an
open cursor (portal). It is stored binary compatible to the text data
type. In the C function, you extract that name (using the textout
function) and use it inside the FETCH query as the cursor name. You may
need to double-quote that string.

Jan

--
Anyone who trades liberty for security deserves neither
liberty nor security. -- Benjamin Franklin

#3Vlad Arkhipov
arhipov@dc.baikal.ru
In reply to: Jan Wieck (#2)
Re: Reading from a REFCURSOR in a C language function

06.04.2011 02:06, Jan Wieck wrote:

On 4/5/2011 3:24 AM, Vlad Arkhipov wrote:

Hi,

I'm trying to write a C language function that has a REFCURSOR argument.
Could anyone please give me an example of reading from a cursor in C
code?

Sorry, I don't have a code example.

A refcursor data type is basically a string, containing the name of an
open cursor (portal). It is stored binary compatible to the text data
type. In the C function, you extract that name (using the textout
function) and use it inside the FETCH query as the cursor name. You
may need to double-quote that string.

Jan

Thanks for the hint. It works great.