I am trying to execute a prepared sql query that updates fields CLOBin an Oracle 10g database (10.2.0.1).
If I run the following query from the inside SQL Developerand set the values for placeholders, there is no prblem. If, however, I executed it through OracleCommand(Oracle.DataAccess.dll, version 1.102.0.1 (I think), .NET Framework 3.5), I get an error message below. Please note that we do not use the oracle client by default, since we need bulk insertion. This version of ODP and the version of the .NET Framework, unfortunately, are a strict requirement, and we cannot change this.
Query:
UPDATE master_table
SET description = :description,
modification_notes = :modification_notes
WHERE master_id = :master_id;
Error:
ORA-00932: : - CLOB
:
:
var param_description = new OracleParameter(":description", OracleDbType.Clob);
param_description.Value = "Test";
:
to_clob() SQLOracle.DataAccess.Types.OracleClob .
, .
CLOB Oracle #
?
, . DESCRIPTION MODIFICATION_NOTES - CLOB .
:
- :
OracleConnection - master_id:
:
: , ,
var query = "UPDATE master_table " +
"SET description = :description " +
" modification_notes = :modification_notes " +
"WHERE master_id = :master_id";
var param_master_id = new OracleParameter(":master_id", OracleDbType.Int64);
param_master_id.Value = master_id;
var param_description = new OracleParameter(":description", OracleDbType.Clob);
param_description.Value = "Test1";
var param_master_id = new OracleParameter(":modification_notes", OracleDbType.Clob);
param_description.Value = "Test2";
IDbCommand command = new OracleCommand(query, connection);
command.parameters.Add(param_master_id);
command.parameters.Add(param_description);
command.parameters.Add(param_modification_notes);
command.ExecuteNonQuery(); // this line throws an exception