Hello all,
We have a problem with the ODP.NET Managed driver 12.1.0.1.0
We have a table that contains among others, a NCLOB column and a BLOB column. In case we try to set for LONG1, more that 4000 characters, the following happens:
the sentence (1) it works as desired, but when we try to execute the sentence (2) it fails throwing an ORA-01483 exception
a) UPDATE TEST SET LONG_1 = :LONG1, LONG_2=:LONG2 WHERE TEST_ID = 1
b) UPDATE TEST SET LONG_1 = :LONG1, LONG_2=:LONG2 WHERE TEST_ID = :TESTID
This is the test table creation sentence:
CREATE TABLE "TEST"
(
"TEST_ID" NUMBER(10,0),
"LONG_1" NCLOB,
"LONG_2" BLOB
)
We made a WIndows Console application to reproduce it, this is the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Oracle.ManagedDataAccess.Client;
namespace TestOracleNClobProblem
{
class Program
{
static void Main(string[] args)
{
const int length = 4001;
byte[] data2 = new byte[length];
using (OracleConnection conn = new OracleConnection(<<connection string>>))
{
conn.Open();
StringBuilder data1 = new StringBuilder();
for (int i = 0; i < length; i++)
{
data1.Append("A");
data2[i] = 10;
}
string sql = "UPDATE TEST SET LONG_1=:LONG1, LONG_2=:LONG2 WHERE TEST_ID = :TESTID";
using (OracleCommand command = new OracleCommand(sql))
{
command.Connection = conn;
command.BindByName = true;
command.CommandTimeout = 0;
command.Parameters.Add("LONG1", data1.ToString());
command.Parameters.Add("LONG2", data2);
command.Parameters.Add("TESTID", 1);
command.ExecuteNonQuery();
}
}
}
}
}
Do anyone have an idea what we are doing wrong?
Thanks in advance
Matias