Page 1 of 1

ORA-00600: inserting binary data into blob on Oracle 10g

Posted: Fri 27 Apr 2007 13:52
by jgoode
We are trying to save a binary file into a blob on Oracle 10g and are getting Ora-0600 and Ora-6502 errors. Here is the code I am using:

oQry := TOraQuery.Create(self);
try

if FbNewObject and FbDirtyData then begin
{Create anm insert statement}
sql := 'INSERT INTO CustInvReport (ReportID, InvoiceNo, Report_File, Invoice_Type, Created_Date, File_Name) VALUES ';
sql := sql + ' (:ReportId, :InvoiceNo, empty_blob(), :InvoiceType, :CreatedDate, :FileName ) ';
sql := sql + ' returning Report_File into :ReportFile';
oQry.SQL.Add(sql);

{Set non-blob columns}
oQry.ParamByName('ReportId').AsInteger := FiReportID;
oQry.ParamByName('InvoiceNo').AsString := FsInvoiceNo;

{Set BLOB column}
oQry.ParamByName('ReportFile').ParamType := ptInput;
oQry.ParamByName('ReportFile').AsOraBlob.LoadFromFile(FsFileName);

{Set non-blob columns}
oQry.ParamByName('InvoiceType').AsInteger := Ord(FeInvoiceType);
oQry.ParamByName('CreatedDate').AsDateTime := FdtCreatedDate;
oQry.ParamByName('FileName').Asstring := FsFileName;



{Execute the SQL}
oQry.Execute;


Result := True;

end;
finally
oQry.Free;
end;

This code works perfect when executed against Oracle 9.x. Any idea why I am getting these errors in 10g?

Posted: Sat 28 Apr 2007 14:34
by Plash
Please supply us the following information
- exact version of ODAC including build number (see Oracle | About ODAC in the Delphi menu);
- exact version of Delphi;
- exact version of the Oracle server and client. You can see it in the Info sheet of TOraSession Editor.
Also specify whether you are using the Net (Direct) option to connect to the database.

Posted: Tue 17 Jul 2007 19:12
by HDumas
Hello,

we are getting exactly the same problem.

Our ODAC version is 5.50.0.15... Our Delphi version is Delphi 7 with Update 1 and our Oracle version is 10.2.0.3

Yes we are using the net(direct).

Could you please reply as soon as possible as we have been working on this problem for a long time.

Thank you very much.

Posted: Wed 18 Jul 2007 12:27
by Plash
We have fixed several problems with BLOBs in recent ODAC builds. You should upgrade your ODAC to the last build of ODAC 5 (5.80.0.42) or ODAC 6 (6.10.0.9).