We read data from CLOB in std::vectorthrough OCCI. The simplified code is 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 gives ORA-32116 error saying that the size of the buffer (3rd read argument) must be equal to or greater than the amount of data to read (1st read argument). This condition, apparently, persists.
After increasing the buffer size to 4 * len:
unsigned have_read = clob.read(len , result.data() , 4 * len);
the operation is performed correctly. Until now, the meanings have_readand lenhave always been identical.
Is there any undocumented extra space needed for the buffer? Or need full pages?
We use "Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit".
Any clarification on this topic is welcome.