dotConnect 5.25 Express and updating raw fields - ORA-00932

dotConnect 5.25 Express and updating raw fields - ORA-00932

Postby dsv » Wed 18 Nov 2009 16:08

I have dotConnect 5.25 Express, Oracle 10.2.0.1 and table

table T
id raw(16)
data blob

When insert

OracleCommand cmd = new OracleCommand();
cmd.Connection = myConnection;
cmd.CommandText = "insert into t (id, data) values (:id, :data)";
cmd.Parameters.Add("id", OracleDbType.Blob, 16);
cmd.Parameters[0].Value = new byte[16] {...}
cmd.Parameters.Add("data", OracleDbType.Blob);
cmd.Parameters[1].Value = File.ReadAllBytes(fileName);
cmd.ExecuteNonQuery();

It works correct.

When update

OracleCommand cmd = new OracleCommand();
cmd.Connection = myConnection;
cmd.CommandText = "update t set data = :data where id = :id";
cmd.Parameters.Add("id", OracleDbType.Blob, 16);
cmd.Parameters[0].Value = new byte[16] {...}
cmd.Parameters.Add("data", OracleDbType.Blob);
cmd.Parameters[1].Value = File.ReadAllBytes(fileName);
cmd.ExecuteNonQuery();

It doesn't work. Error ORA-00932 - inconsistent datatypes.

When on update i'm writing
cmd.Parameters.Add("data", OracleDbType.Raw);
it works.

Why doesn't work update with OracleDbType.Blob?
Why work insert with cmd.Parameters.Add("id", OracleDbType.Blob, 16)?

Thank you very much.
dsv
 
Posts: 1
Joined: Wed 18 Nov 2009 15:46

Postby Shalex » Thu 19 Nov 2009 11:47

This is an Oracle server error, we just pass it via our interface. If the datatype in the table is raw, we recommend you to use the OracleDbType.Raw type of OracleParameter.
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle