Problem with saving file from database

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
KDEGRAAF
Posts: 2
Joined: Wed 05 Dec 2007 10:13

Problem with saving file from database

Post by KDEGRAAF » Fri 25 Apr 2008 07:44

Hi all,

I was using odac 5.70.1.34 and getting files from the database was working fine.

But now I am using version 6.25.2.15 and if I download a file now it is saved with filesize 0 bytes.

This is my code:

Code: Select all

  SelectDocumentQuery.ParamByName('DOC_TYPE').Asstring:=SelectDocumentsQuery.FieldbyName('DOC_TYPE').Asstring;
  SelectDocumentQuery.ParamByName('DOC_KEY').AsFloat:=SelectDocumentsQuery.FieldbyName('DOC_KEY').Asinteger;
  SelectDocumentQuery.ParamByName('SEQ_NUMBER').Asinteger:=SelectDocumentsQuery.FieldbyName('SEQ_NUMBER').Asinteger;
  SelectDocumentQuery.Execute;
  DeFileName:='C:\temp\+SelectDocumentsQuery.FieldbyName('FileName').AsString;
  SelectDocumentQueryDocument.SaveToFile(DeFileName);
This is the query:

Code: Select all

Select DOCUMENT
From XX_DOCUMENTS
WHERE DOC_TYPE=:DOC_TYPE AND
      DOC_KEY=:DOC_KEY AND 
      SEQ_NUMBER=:SEQ_NUMBER
SelectDocumentQueryDOCUMENT is of the type TBlobField;

What is going wrong?
What is changed in the new odac component that I don't know?

Thanks in advance.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 25 Apr 2008 09:11

We could not reproduce the problem. Please send us to odac*crlab*com a complete small sample that demonstrates the problem, including the script for creating database objects.

KDEGRAAF
Posts: 2
Joined: Wed 05 Dec 2007 10:13

Post by KDEGRAAF » Fri 25 Apr 2008 12:35

I just did send a small demo project.

The problem is if on the OraSession the option direct is false.
If direct is true it works.

Post Reply