Page 1 of 1

ORA-01461: can bind a LONG value only for insert into a LONG

Posted: Thu 14 Oct 2010 16:10
by flutos
using directmode=true, trying to insert into a nvarchar2(2000) column generates this error when the text string length is 900 which should work since the column length is 2000, when the string length is 500 it works. If I dont use direct mode =true then everything seems to work ok. is there some other limitation of direct mode that would cause this to happen? Note since we are also using mono we have to use directmode=true.

thanks

scott

Posted: Thu 14 Oct 2010 16:44
by flutos
actually found that the dbparameter dbtype was Varchar but I was changing it to Nvarchar and that seemed to cause the problem . The question is why it would just cause this problem using directmode=true?

Posted: Thu 14 Oct 2010 16:45
by Shalex
I have tried the following code with the 5.70.180 version of dotConnect for Oracle. It works.

Code: Select all

//   CREATE TABLE TESTNVARCHAR (
//     NVARCHARCOLUMN NVARCHAR2(2000))

            using (OracleConnection conn = new OracleConnection()) {
                conn.ConnectionString = "Direct=true;server=db;port=1525;SID=***;uid=***;pwd=***;";
                conn.Open();
                OracleCommand command = conn.CreateCommand();
                command.CommandText = "insert into testnvarchar(NVARCHARCOLUMN) values (:p1)";
                command.Parameters.Add("p1", OracleDbType.NVarChar, 2000, "NVARCHARCOLUMN").Value = new string('a', 2000);
                command.ExecuteNonQuery();
            }
Please try the 5.70.180 version and notify us about the results.

Posted: Thu 14 Oct 2010 16:51
by flutos
ya, I noticed the new version has a fix related to this so Ill give this new version a try and see if that works.

thanks