| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> blobs truncated to 256 bytes
and I thought a 4K limit was bad :-) !
I have an application whihc saves fax images to a generic database via
ODBC, Using MySQL, Sybase or even MS-SQL as the database this works but when I use Oracle all the fax images are truncated at 256 bytes. The same code is used to save the image in all versions with a change in the table definitions to accomodate any non standard fields. In this case this means defining the fax data as a Blob (cf LONG VARBINARY in MySQL and IMAGE in Sybase)
i.e.
SQL> select messageid, dbms_lob.getlength(faxdata) from fax;
returns
MESSAGEID DBMS_LOB.GETLENGTH(FAXDATA)
The table defintion is;
CREATE TABLE FAX (MESSAGEID CHAR(21) NOT NULL,
IMAGESUFFIX INTEGER NOT NULL,
FAXPART INTEGER NOT NULL,
FAXDATA BLOB,
BACKEDUP1 INTEGER DEFAULT 0 NOT NULL,
BACKEDUP2 INTEGER DEFAULT 0 NOT NULL,
PRIMARY KEY (MESSAGEID, IMAGESUFFIX, FAXPART));
The code which saves the fax image is;
{ save fax image data for message }
procedure TArchiveDataBase.SaveFaxData(Msg : THostMessage;
ImageSuffix : Integer);
var
FieldList : string;
FaxPartStream : TMemoryStream;
FaxPart : Integer;
FieldList := MessageIDFld + ',' +
ImgSuffixFld + ',' +
FaxPartFld + ',' +
FaxDataFld;
FaxPartStream.CopyFrom(Msg.FaxData, Msg.FaxData.Size);
{ why does this truncate to 256 bytes? }
with Query do
begin
{ Field2Param converts 'field1,field2' ... into
':field1,:field2' etc. }
SQL := 'INSERT INTO ' + ImgFaxTable +
' (' + FieldList + ')' +
' VALUES (' + Field2Param(FieldList) + ')';
Prepare;
BindStringByName(MessageIDFld, Msg.MessageID);
BindIntegerByName(ImgSuffixFld, ImageSuffix);
BindIntegerByName(FaxPartFld, FaxPart);
BindMemoryByName(FaxDataFld, FaxPartStream, true);
Execute;
end;
finally
FaxPartStream.Free;
As far as I can tell shouldn't need to set anything else and, as the code works under three other databases, I'm reasonably confident that is OK. So can anyone suggest what else I should be looking at?
PS all of this is under Oracle 8.1.7 with the standard 8.1.7 ODBC drivers accessed from a Delphi 3 application or SQLPLUS running under NT4 (just in case that makes a difference)
TIA Received on Tue Sep 04 2001 - 07:30:07 CDT
![]() |
![]() |