We are reading data from a CLOB into an std::vector
via OCCI. The simplified code looks as follows:
oracle::occi::Clob clob = result.getClob( 3 );
unsigned len = clob.length();
std::vector< unsigned char > result( len );
unsigned have_read = clob.read( len , result.data() , len );
This yields the error ORA-32116, saying that the buffer size (3rd argument of read) should be equal or greater than the amount of data to be read (1st argument of read). This condition is apparently held.
After increasing the buffer size to 4*len:
unsigned have_read = clob.read(len , result.data() , 4 * len);
the operation is performed properly. So far, the values of have_read
and len
were always identical.
Is there an undocumented extra amount of space needed for the buffer? Or are complete pages needed?
We are using "Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit".
Any clarification on the topic is welcome.