Inserting a value to a CLOB column using .NET base classes
Posted: Mon 21 Apr 2008 09:49
Hello, I'm using OraDirect v4.50 and I would like to know if its possible to insert/update values of a CLOB column using only the .NET base classes (DbConnection, DbCommand, DbParameter) and the enumeration DbType.
With Direct=true on the connection string I'm getting the following error:
"ORA-01460: unimplemented or unreasonable conversion requested"
Not using direct connection I get the error:
"ORA-01461: can bind a LONG value only for insert into a LONG column"
Example:
Thanks,
João Angelo
With Direct=true on the connection string I'm getting the following error:
"ORA-01460: unimplemented or unreasonable conversion requested"
Not using direct connection I get the error:
"ORA-01461: can bind a LONG value only for insert into a LONG column"
Example:
Code: Select all
string sqlCmd;
// txt is the CLOB column
sqlCmd = "INSERT INTO T_CLOB (id, txt) VALUES (:id, :text)";
DbCommand cmd = dbConnection.CreateCommand();
cmd.CommandText = sqlCmd;
string longText = new String('x', 6000);
cmd.Parameters.Add(":id", 1);
cmd.Parameters.Add(":text", longText);
cmd.ExecuteNonQuery();
João Angelo