Link to home
Start Free TrialLog in
Avatar of barnarp
barnarp

asked on

TBlobField SaveToFile

The following open question in Delphi refers: https://www.experts-exchange.com/questions/21109485/Oracle-BLOB-field-SaveToFile-unsuccessful.html

I am really desperate at this stage. My problem is that the following code, does not download the files correctly. They are corrupted (so it seems) with retrieval from the database.

Both questions points to accepted answer.

with dm.qBLOB do //tquery
  begin
      Close;
      SQL.Clear;
      SQL.Add('SELECT CPLANT_BLOB FROM DOCBLOB WHERE DOCUMENT = :DOC');
      parambyname('DOC').AsString := curdocid.Text; //editbox
      Open;
      try
      TBlobField(dm.qBLOB.FieldByName('CPLANT_BLOB')).SaveToFile(dirname);
      Close;
      MessageDlg(curdoctitle.Text + ' successfully retrieved from the database.', mtInformation, [mbOK], 0 );
     
  except
  Close;
  MessageDlg(curdoctitle.Text + ' could not be retrieved from the database.', mtError, [mbOK], 0 );
  Exit;
  end;
end;
end;

BDE BLOB setting:

DB.Params.add('BLOB SIZE=9000');

Any help please

Any help please
Avatar of kretzschmar
kretzschmar
Flag of Germany image

>DB.Params.add('BLOB SIZE=9000');
9000 is a too high value -> max limit is 1000 (1MB),
this entry applys only for dead datasets (non live)

well usual it should work without any corruption,
maybe you need an update of the bde or the sqllinks

what bde-version do you use?
Avatar of barnarp
barnarp

ASKER

BDE version 5.01

I changed the code to DB.Params.add('BLOB SIZE=1000');

Still no change. I will now try to change the BLOB field to LONG RAW on the database and see if that makes a difference.
in the BDE, on Drivers page, you was able to choose 2 Dll's. One of the was not working properly, but I don't remember which exactly.

Maybe you can View / Blob Explorer and try to view blob field from there. Maybe it will give you some more reasonable error....
ASKER CERTIFIED SOLUTION
Avatar of barnarp
barnarp

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
glad you solved it this way,

but it should also work with a blob-type, just courious

meikl ;-)
Avatar of barnarp

ASKER

Thanks for all the comments
Avatar of barnarp

ASKER

Yes thanks