Blob fields

rcoyle

Member²
This is a post from the Delphi newsgroup that went unanswered. Maybe someone here can shed some light on this issue.
I am using Delphi6 with Direct Oracle Access components in a 3tier
project. I have some data that has been stored into a database blob
field. I want to create a file on the local hard drive that contains
the data that was stored in the blob field. I have provided a sample of
the code below, however, my problem is that the created file is only 32k
in size. The original file that this data comes from is 48k. I know
that the data is stored correctly via some other tests that I have
done. I am using a TClientdataset to create the stream on the client
side and the TOracleDataset in the muddle tier. The blob size seems to
be set at 32768 which limits the real output of my file to that amount
of data.

try
BlobData := tmpCDS.CreateBlobStream(
tmpCDS.FieldByName('RPTTEMPLATE'), bmRead ) ;
rptSaveFile := TFileStream.Create('C:\' +
tmpCDS.FieldByName('rptname').asString, fmCreate );
rptSaveFile.CopyFrom( BlobData, BlobData.Size );
finally
BlobData.Free ;
FreeAndNil(rptSaveFile) ;
end;
 
Perhaps you can use the Oracle Monitor to find out how this BLOB data is written?

------------------
Marco Kalter
Allround Automations
 
The following code works for us in D5 with DOA 3.4.5 and Oracle 8.1.7 R3:

...
// Create a Blob TStream from the Field, Load it to a TMemoryStream, Write the Memory Stream to File
FMyStream := CreateBlobStream(FFieldDataLink.Field as TBlobField, bmRead);
MemStream := TMemoryStream.Create;
MemStream.LoadFromStream(FMyStream);
MemStream.SaveToFile(FMyFileName);
...

[This message has been edited by ajstadlin (edited 11 March 2002).]
 
Back
Top