Thanks for the response. But it does not seem to work. I am not able to
figure out what the problem could be.
Here is the code snippet i am using.
********************************************************
FileStream fs = new
FileStream("myfile.dll",FileMode.Open,FileAccess.Read);
byte[] file = new byte[fs.length];
fs.Read(file,0,(int)file.Length);
fs.Close();
OracleConnection conn = new OracleConnection("connectionString");
OracleCommand cmd = conn.CreateCommand();
OracleParameter param5 = new OracleParameter("p_file",OracleType.Blob);
param5.Direction = ParameterDirection.Input;
param5.Value = file;
cmd.Paramaeters.Add(param5);
string qry = "ADDFILE";
cmd.CommandText = qry;
cmd.CommandType = CommandType.StoredProcedure;
conn.open();
cmd.ExecuteNonQuery();
conn.close();
********************************************************
Oracle stored procedure
//appfiles ia table with a blob column
procedure AddFile(,p_file in blob)
is
begin
insert into appfiles(ffile_obj)
values (p_file);
end AddFile;
********************************************************************
Thanks for the Help...
MrSmersh said:
The database type should be "BLOB".
In pseudo code are the blob write operations for Oracle.
If you have more questions, ask.
byte[] blobValue;
SelectString=String.Format("UPDATE {0} SET {1} = :blobdata {2}
",tableName,columnContainingBlobName,whereClause);
System.Data.OracleClient.OracleCommand Command =
Command.CommandText = SelectString;
Command.Connection = _Connection;
Command.Transaction = _Transaction;
Command.CommandTimeout=CommandTimeout;
System.Data.OracleClient.OracleParameter dataParameter;
dataParameter.ParameterName = "blobdata";
dataParameter.DbType = System.Data.DbType.Binary;
dataParameter.Direction=ParameterDirection.Input;
dataParameter.Value = blobValue;
dataParameter.Size=blobValue.Length;
Command.Parameters.Add(dataParameter);
Result=Command.ExecuteNonQuery();
:
Hello,
I am trying to store a binary file in a blob column of a
oracle
table but i get the following exception " ORA-01460: unimplemented or
unreasonable conversion requested". Any insight as to why this may
happen??
It seems to work fine if the data size is small (weird??). I am using
.NET
1.1 and Systsem.Data.OracleClient to connect to Oracle 9.1.
Any thoughts??
Thanks
Bala