10.12.2012 Views

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Statement Class<br />

Note that not all types can be supplied in the buffer. For example, all OCCI<br />

allocated types (such as Bytes, Date and so on.) cannot be provided by the<br />

setDataBuffer interface. Similarly, <strong>C++</strong> Standard Library strings cannot be<br />

provided with the setDataBuffer interface either. The type can be any of OCI<br />

data types such VARCHAR2, CSTRING, CHARZ and so on.<br />

If setDataBuffer() is used to specify data for iterative or array executes, it<br />

should be called only once in the first iteration only. For subsequent iterations,<br />

OCCI would assume that data is at buffer + i*size location where i is the<br />

iteration number. Similarly the length of the data would be assumed to be at<br />

*(length + i).<br />

Syntax<br />

void setDataBuffer(unsigned int paramIndex,<br />

void *buffer,<br />

Type type,<br />

sb4 size,<br />

ub2 *length,<br />

sb2 *ind = NULL,<br />

ub2 *rc= NULL);<br />

Parameters<br />

paramIndex<br />

The first parameter is 1, the second is 2, . . . .<br />

buffer<br />

Pointer to user-allocated buffer; if iterative or array executes are done, it should<br />

have numIterations * size bytes in it.<br />

type<br />

Type of the data that is provided (or retrieved) in the buffer<br />

size<br />

Size of the data buffer; for iterative and array executes, it is the size of each element<br />

of the data items<br />

length<br />

Pointer to the length of data in the buffer; for iterative and array executes, it should<br />

be an array of length data for each buffer element; the size of the array should be<br />

equal to arrayLength.<br />

OCCI Classes and Methods 8-195

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!