Subject Large BLOB download
Author Maik Wojcieszak

Hi,

 

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.

 

  if InitIBCursor(iDownloadThumbQry,'iDownloadThumbQry',tr) then

  begin

   with iDownloadThumbQry do begin

      KeyLinksAutoDefine := False;

      //                 0

      SQL.Add('select IMAGE_DATA from IMAGE_TAB');

      SQL.Add('where IMAGE_ID = :iid');

   end;

  end;

 

  ds := iDownloadThumbQry;

 

  try

    if not DS.Prepared then DS.Prepare;

    DS.ParamByName('iid').AsInt64 := imageid;

    DS.Open;

    DS.First;

 

 

I’m reading the blobid with

 

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

 

and pass it to my download function.

Is there a way to get the BLOB id without opening the field in a TIBQuery ?

 

Thanks,

Maik