Invalid BLOB handle in record buffer(50分)

H

hotsoup

Unregistered / Unconfirmed
GUEST, unregistred user!
在下用delphi6的query控件从oracle数据库中读取含有varchar (2000)字段的记录,始终无法
超过64条,否则就报“Invalid BLOB handle in record buffer”的错误。将bde中的
BLOB SIZE 和 BLOBS TO CACHE改大也没有效果。请各位大侠指点迷津,多谢了。
 
看BLOBS TO CACHE的帮助。特别是如下这段:
Setting a value 100 means the application can work with a maximum
of 100 BLOB records cached. Fetching more than 100, then scrolling
back 100 records results in an "Invalid Blob handle in record buffer"
error message.

BLOBS TO CACHE的默认值是64,那么就是说包含blob字段的query or table的记录数
不能超过64条记录,所以你要么改大BLOBS TO CACHE的值,最大可达65535,要吗提取的
记录数(cache)不能太多。
还有记录数太多的话要相应改大BLOB SIZE的值, 默认是32K,一个文件8K的话,那么只能
cache 4条记录,最大可为1000K。所以cache的记录数不能太多。
 
改了,但没有用。
 
我认为跟BLOB SIZE 和 BLOBS TO CACHE没有关系,关键
可能出现在你的代码中,有可能是对QUERY的使用上,你能将你的代码写出来看一下吗?
 
我是从数据库中读取数据来拼成xml文件,节选如下:
with rptstep1.RptForm1.SqlQuery do
begin
close;
sql.Clear;
sql.Add(ArrRptCmd[rptstep1.RptForm1.Com_Titles.ItemIndex].getSql_Cmd());
open;
end;


while not rptstep1.RptForm1.SqlQuery.Eof do
begin
state.StateForm.ProgressBar1.StepIt;
result := result + '<row>' + Enter;
SumColumn := 0;
//&amp;Egrave;&amp;ccedil;&amp;sup1;&amp;ucirc;&amp;Eacute;ú&amp;sup3;&amp;Eacute;&amp;ETH;ò&amp;ordm;&amp;Aring;
if rptstep3.RptForm3.Check_No.State = cbchecked then
begin
startindex := 1;
result := result + '<col1>' + inttostr(j+1) + '</col1>' + Enter
end
else
startindex := 0;
//&amp;Egrave;&amp;ccedil;&amp;sup1;&amp;ucirc;&amp;frac12;&amp;oslash;&amp;ETH;&amp;ETH;&amp;ETH;&amp;ETH;&amp;Iacute;&amp;sup3;&amp;frac14;&amp;AElig;
if rptstep3.RptForm3.getSumColState = true then
begin
//&amp;Egrave;&amp;ccedil;&amp;sup1;&amp;ucirc;&amp;frac12;&amp;oslash;&amp;ETH;&amp;ETH;&amp;Aacute;&amp;ETH;&amp;Iacute;&amp;sup3;&amp;frac14;&amp;AElig;
if rptstep3.RptForm3.getSumRowState() = true then
begin
for i:=0 to fc-1 do
begin
if TBlobField(rptstep1.RptForm1.SqlQuery.Fields).AsString <> null then
begin
result := result + '<col' + inttostr(i+1+startindex) + '>' + TBlobField(rptstep1.RptForm1.SqlQuery.Fields).AsString + '</col' + inttostr(i+1+startindex) + '>' + Enter;
if rptstep3.RptForm3.Check_SumCol.State[ArrColno] = cbchecked then
begin
SumColumn := SumColumn + strtofloatdef(TBlobField(rptstep1.RptForm1.SqlQuery.Fields).AsString,0);
// if rptstep3.RptForm3.Check_SumRow.State[ArrColno] = cbchecked then
SumRowArr := SumRowArr + strtofloatdef(TBlobField(rptstep1.RptForm1.SqlQuery.Fields).AsString,0);
end;
end
else
result := result + '<col' + inttostr(i+1+startindex) + '></col' + inttostr(i+1+startindex) + '>' + Enter;
end;
result := result + '<col' + inttostr(fc+startindex+1) + '>'+floattostr(SumColumn)+'</col' + inttostr(fc+startindex+1) + '>' + Enter;
//&amp;Iacute;&amp;sup3;&amp;frac14;&amp;AElig;&amp;ETH;&amp;ETH;&amp;Iacute;&amp;sup3;&amp;frac14;&amp;AElig;
SumSumColumn := SumSumColumn + SumColumn;
end
else//&amp;Egrave;&amp;ccedil;&amp;sup1;&amp;ucirc;&amp;sup2;&amp;raquo;&amp;frac12;&amp;oslash;&amp;ETH;&amp;ETH;&amp;Aacute;&amp;ETH;&amp;Iacute;&amp;sup3;&amp;frac14;&amp;AElig;
begin
for i:=0 to fc-1 do
begin
if TBlobField(rptstep1.RptForm1.SqlQuery.Fields).AsString <> null then
begin
result := result + '<col' + inttostr(i+1+startindex) + '>' + (TBlobField(rptstep1.RptForm1.SqlQuery.Fields).AsString) + '</col' + inttostr(i+1+startindex) + '>' + Enter;
if rptstep3.RptForm3.Check_SumCol.State[ArrColno] = cbchecked then
SumColumn := SumColumn + strtofloatdef(TBlobField(rptstep1.RptForm1.SqlQuery.Fields).AsString,0);
end
else
result := result + '<col' + inttostr(i+1+startindex) + '></col' + inttostr(i+1+startindex) + '>' + Enter;
end;
result := result + '<col' + inttostr(fc+startindex+1) + '>'+floattostr(SumColumn)+'</col' + inttostr(fc+startindex+1) + '>' + Enter;
//&amp;Iacute;&amp;sup3;&amp;frac14;&amp;AElig;&amp;ETH;&amp;ETH;&amp;Iacute;&amp;sup3;&amp;frac14;&amp;AElig;
SumSumColumn := SumSumColumn + SumColumn;
end;
end//end for rptstep3.RptForm3.getSumColState
 
多人接受答案了。
 
顶部