Page 1 of 1

Problem with saving file from database

Posted: Fri 25 Apr 2008 07:44
by KDEGRAAF
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.

Posted: Fri 25 Apr 2008 09:11
by Plash
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.

Posted: Fri 25 Apr 2008 12:35
by KDEGRAAF
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.