ORA-00600: inserting binary data into blob on Oracle 10g
Posted: Fri 27 Apr 2007 13:52
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?
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?