I've come accross with this problem while trying to figure out NHibernate's Identiy sequence mapping. When the Culture is set as Turkish(tr-TR) a query that includes RETURNING INTO statements throws ORA-03146: Invalid buffer length for TTC field error. Same query executes fine when the culture is set as Invariant or en-US. Here is the template for reproducing(I don't know how to refer to a sample project with an Oracle database, if such thing exist I can update the issue with sample project).
using (OracleConnection oc = new OracleConnection())
{
var culture = CultureInfo.GetCultureInfo("tr-TR");
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
oc.ConnectionString = "User ID=<user_id>; Password=<password>; Data Source=<data_source>;";
oc.Open();
string sql = "INSERT INTO ALL_SETS_OBJS (SETOBJID, OID, SETID, CLID, PK1, PK2, PK3, PK4) VALUES " +
"(ALL_SETS_OBJS_SEQ.nextval, 28601, 818453, 310, '596', '', '', '') returning SETOBJID into :nhIdOutParam";
OracleCommand cmd = new OracleCommand(sql, oc)
{
CommandType = CommandType.Text
};
OracleParameter nhIdOutParam = new OracleParameter
{
OracleDbType = OracleDbType.Decimal
};
cmd.Parameters.Add(nhIdOutParam);
OracleDataReader dr = cmd.ExecuteReader();
dr.Read();
}
Console.ReadLine();
OracleDataReader dr = cmd.ExecuteReader();
dr.Read();
}
Console.ReadLine();
Console.ReadLine();
Oracle.ManagedDataAccess version 19.7.0
Message was edited by: d9c65753-bb8e-4a3b-8026-d75fccee2bdc