Board index » delphi » IBM DB2 and Delphi - can connect through CLI? (For large blobs)

IBM DB2 and Delphi - can connect through CLI? (For large blobs)

BDE can't read part of the blob. DB2 allows it through CLI. Also it allows
put it directly to file. Is there somewhere header files? Can I get from
BDE handle needed for CLI?

jevg...@yahoo.com

 

Re:IBM DB2 and Delphi - can connect through CLI? (For large blobs)


Are you using the BDE calls ?

 Dataset.updatecursorpos;
 check(dbiOpenBlob(Dataset.handle, Dataset.activebuffer,
Dataset.fieldbyname(FieldName).fieldNo, dbiReadOnly));
 try
  check(dbiGetBlobSize(Dataset.Handle, Dataset.ActiveBuffer,
Dataset.fieldbyname(FieldName).FieldNo,BufferSize));
  if BufferSize < 1 then
  begin
   Buffer := nil;
   BufferSize := -1;
   exit;
  end;
  inc(buffersize);
  if Get_buffer(Buffer, Buffersize) then
   check(dbiGetBlob(Dataset.Handle, Dataset.ActiveBuffer,
Datset.fieldbyname(FieldName).FieldNo , 0, BufferSize-1, buffer,
result_size));

finally
  Check(dbiFreeBlob(Dataset.handle, Dataset.ActiveBuffer,
Dataset.fieldbyname(FieldName).FieldNo));
end;

Quote
Jevgeny Pyatakov wrote:
> BDE can't read part of the blob. DB2 allows it through CLI. Also it allows
> put it directly to file. Is there somewhere header files? Can I get from
> BDE handle needed for CLI?

> jevg...@yahoo.com

Re:IBM DB2 and Delphi - can connect through CLI? (For large blobs)


That doesn't work. BDE load whole blob on dbiOpenBlob (!), so you can't
choose part of the blob. More, BDE retrieves by 8k (very slow), and after
~25M DB2 v5 generates an error, so by far its impossible to work wiyh large
blobs!
(I inserted your code exactly in my code, but...)

Jim Carpenter <J-E.Carpen...@worldnet.att.net> ???? a ?t
<3544C82A.A1452...@worldnet.att.net>...

Quote
> Are you using the BDE calls ?

>  Dataset.updatecursorpos;

Re:IBM DB2 and Delphi - can connect through CLI? (For large blobs)


Jim Carpenter D??? ???Y?? <3544C82A.A1452...@worldnet.att.net> ...

Quote
>Are you using the BDE calls ?
>> put it directly to file. Is there somewhere header files? Can I get from
>> BDE handle needed for CLI?

you can

DbiGetProp(hDb, dbNATIVEHNDL, &hNativeDb, sizeof(hNativeDb), &Size);

Quote

>> jevg...@yahoo.com

Other Threads