sqldata/sqlociapi.cpp
// Allocate the buffer to read the LOB value depending on character lengths
Allocate the buffer to read the LOB value depending on character lengths
Allocate the buffer to read the LOB value depending on character lengths
char* SqlOciApi::GetLobBuffer(size_t row, size_t column, size_t length, size_t *alloc_len) 
{ 
	if(_cursor_cols == NULL || row >= _cursor_allocated_rows || column >=_cursor_cols_count || length <= 0)
		return NULL;
	size_t buf_len = length;
	if(_cursor_cols[column]._native_dt == SQLT_CLOB)
		buf_len = length * GetCharMaxSizeInBytes();
	char *buf = new char[buf_len];
	if(alloc_len != NULL)
		*alloc_len = buf_len;
	return buf; 
}
char * SqlOciApi :: GetLobBuffer ( size_t row , size_t column , size_t length , size_t * alloc_len ) { if ( _cursor_cols == NULL || row >= _cursor_allocated_rows || column >= _cursor_cols_count || length <= 0 ) return NULL ; size_t buf_len = length ; if ( _cursor_cols [ column ] . _native_dt == SQLT_CLOB ) buf_len = length * GetCharMaxSizeInBytes ( ) ; char * buf = new char [ buf_len ] ; if ( alloc_len != NULL ) * alloc_len = buf_len ; return buf ; }
Allocate the buffer to read the LOB value depending on character lengths
Allocate the buffer to read the LOB value depending on character lengths
// For CLOB input length is in bytes, define buffer size according the character set