Oracle Blob
Posted: Mon 05 Mar 2012 18:42
I have tried everything I can think of to update a remote oracle database's
blob field.
Connection string is:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=XXXXX.STL.MO.BOEING.COM)(PORT=1521))(CONNECT_DATA=(SID=XXXXX)))
The below code works if the blob size is small. When it is big 4.6M I get an
ORA-01460: unimplemented or unreasonable conversion requested.
Any idea how to make this work?
Thanks!
Marshall Watts
[email protected]
l_cStream = new TMemoryStream;
l_cStream->LoadFromFile( Helper->m_cAttachments[ i ]->m_aFilename );
OraQuery->SQL->Clear();
OraQuery->SQL->Add( "insert into Parts_Owner.P_ORDERS_ATTCHMNTS_YG5D3A9K_VW ( attachment_id, attachment_name, attachment, app_id )" );
OraQuery->SQL->Add( " values( :attachment_id, :attachment_name, :attachment, :app_id )" );
OraQuery->SQL->Add( " returning attachment_id INTO :attachment_id" );
OraQuery->Params->Items[0]->Value = "";
OraQuery->Params->Items[1]->Value = ExtractFileName( Helper->m_cAttachments[ i ]->m_aFilename );
OraQuery->Params->Items[2]->ParamType = ptInput;
OraQuery->Params->Items[2]->SetBlobData( l_cStream->Memory, (int)l_cStream->Size );
OraQuery->Params->Items[3]->AsString = "YG5D3A9K";
OraQuery->ExecSQL();
Helper->m_cAttachments[ i ]->m_iAttachmentID = OraQuery->ParamByName( "attachment_id" )->AsInteger;
delete l_cStream;
blob field.
Connection string is:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=XXXXX.STL.MO.BOEING.COM)(PORT=1521))(CONNECT_DATA=(SID=XXXXX)))
The below code works if the blob size is small. When it is big 4.6M I get an
ORA-01460: unimplemented or unreasonable conversion requested.
Any idea how to make this work?
Thanks!
Marshall Watts
[email protected]
l_cStream = new TMemoryStream;
l_cStream->LoadFromFile( Helper->m_cAttachments[ i ]->m_aFilename );
OraQuery->SQL->Clear();
OraQuery->SQL->Add( "insert into Parts_Owner.P_ORDERS_ATTCHMNTS_YG5D3A9K_VW ( attachment_id, attachment_name, attachment, app_id )" );
OraQuery->SQL->Add( " values( :attachment_id, :attachment_name, :attachment, :app_id )" );
OraQuery->SQL->Add( " returning attachment_id INTO :attachment_id" );
OraQuery->Params->Items[0]->Value = "";
OraQuery->Params->Items[1]->Value = ExtractFileName( Helper->m_cAttachments[ i ]->m_aFilename );
OraQuery->Params->Items[2]->ParamType = ptInput;
OraQuery->Params->Items[2]->SetBlobData( l_cStream->Memory, (int)l_cStream->Size );
OraQuery->Params->Items[3]->AsString = "YG5D3A9K";
OraQuery->ExecSQL();
Helper->m_cAttachments[ i ]->m_iAttachmentID = OraQuery->ParamByName( "attachment_id" )->AsInteger;
delete l_cStream;