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

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
flutos
Posts: 31
Joined: Tue 06 Oct 2009 21:55

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

Post by flutos » Thu 14 Oct 2010 16:10

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

flutos
Posts: 31
Joined: Tue 06 Oct 2009 21:55

Post by flutos » Thu 14 Oct 2010 16:44

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?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 14 Oct 2010 16:45

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.

flutos
Posts: 31
Joined: Tue 06 Oct 2009 21:55

Post by flutos » Thu 14 Oct 2010 16:51

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

Post Reply