- 论坛徽章:
- 0
|
long lLength = 256 * 256;
char *pBuf = new char[ lLength ];
memset( pBuf, 0, lLength );
// stream write
long lOffset = 0;
ub4 lAmtp1 = lLength * 100;
for( long i = 0; i < 100; i ++ )
{
ub1 piece = OCI_NEXT_PIECE;
if( i == 0 )
{
piece = OCI_FIRST_PIECE;
}
else if( i == 99 )
{
piece = OCI_LAST_PIECE;
}
st = cBase.WriteBLOB(
(char *)pBuf,
lLength,
&lAmtp1,
lOffset,
cTab.TDData, //一个表中查询出来的BLOB字段的lob定位符
piece);
st = cBase.WriteBLOB(
(char *)pBuf,
lLength,
&lAmtp1,
lOffset,
cTab2.TDData, //另一个表中查询出来的BLOB字段的lob定位符
piece
);
if( ( st != OCI_NEED_DATA ) && ( st != OCI_SUCCESS ) )
{
printf( "Write Tile To DB Error!\n" );
}
}
/////////////////////////////////////////////////////
出现ORA-24810错误:正在尝试写入多于指定的数据
和 ORA-24811错误:提供写入的数据少于指定的数据
/////////////////////////////////////////////////////
但是循环改为如下:
for( long i = 0; i < 100; i ++ )
{
ub1 piece = OCI_NEXT_PIECE;
if( i == 0 )
{
piece = OCI_FIRST_PIECE;
}
else if( i == 99 )
{
piece = OCI_LAST_PIECE;
}
st = cBase.WriteBLOB(
(char *)pBuf,
lLength,
&lAmtp1,
lOffset,
cTab.TDData, //一个表中查询出来的BLOB字段的lob定位符
piece);
if( ( st != OCI_NEED_DATA ) && ( st != OCI_SUCCESS ) )
{
printf( "Write Tile To DB Error!\n" );
}
}
for( long i = 0; i < 100; i ++ )
{
ub1 piece = OCI_NEXT_PIECE;
if( i == 0 )
{
piece = OCI_FIRST_PIECE;
}
else if( i == 99 )
{
piece = OCI_LAST_PIECE;
}
st = cBase.WriteBLOB(
(char *)pBuf,
lLength,
&lAmtp1,
lOffset,
cTab2.TDData, //另一个表中查询出来的BLOB字段的lob定位符
piece
);
if( ( st != OCI_NEED_DATA ) && ( st != OCI_SUCCESS ) )
{
printf( "Write Tile To DB Error!\n" );
}
}
就不会发生任何错误,请问这究竟事什么原因,请各位高手指条明路,在下感激
不尽,谢谢! |
|