Subject Re: [IBO] Large BLOB download
Author Geoff Worboys
Maik Wojcieszak mw@... [IBObjects] wrote:
> I’m trying to download a huge blob, about 250MB, from the
> firebird database with IBObjects.
>
> It seems the TIBQuery object is loading the BLOB data as
> soon as I open it.

Are we talking TIB_Query or TIBOQuery?

Not that it probably matters in this case (although I'm less
familiar with TIBOQuery). Is there any chance you have a
component connected to the field that is loading it?

In general, IBO doesn't load a blob until something requests
it (I rely on this behaviour).

If you don't see obvious reasons in your own code, then put
in breakpoints so that you can see the callstack in Delphi
and see what is calling it. ... Lots of possibilities for
a breakpoint, the easiest might be in IB_Session.pas at the
start of: TIB_SessionBase.SysGetBlobData
or you could try: TIB_Statement.CreateBlobStream



Also, instead of playing with SQLVAR directly, use IBO's
classes. So not this:

blobid := pisc_quad(DS.Fields[0].PSQLVAR^.sqldata)^;

but this:

blobid := TIB_ColumnBlob(DS.Fields[0]).BlobID;

Again, this is unlikely to be a cause of the problem, but it
is bad form to go looking at the technical detail unnecessarily
We put classes around things to try and hide all that.

--
Geoff Worboys
Telesis Computing Pty Ltd