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
davidxu
Posts: 3
Joined: Wed 27 Jul 2011 00:41

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

Post by davidxu » Wed 27 Jul 2011 00:55

There is a post about my issue before. However, the answer in the post did not fix my problem.
http://www.devart.com/forums/viewtopic. ... c650c2a60a

I have dotConnect for Oracle version 5.70.180.0. I have an Oracle table column of NVARCHAR2(2000). However, I cannot insert more than 666 characters into the column. I tested with the same example from the post above, but it failed to work in my environment.

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(); 
When I checked library dll versions, I noticed that in my 5.70.180 package, the versions of Devart.Data.dll and Devart.Data.Oracle.dll are different.

Devart.Data.dll 5.0.134.0
Devart.Data.Oracle.dll 5.70.180.0

Could it be a devart library issue? Or is it caused by something else? My guess is that the library assumes Unicode character is 3 bytes per character, so it only takes up to 666 at the end, and it fails when string length is 667 or longer.

Thanks,
David

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

Post by Shalex » Fri 29 Jul 2011 15:41

davidxu wrote:When I checked library dll versions, I noticed that in my 5.70.180 package, the versions of Devart.Data.dll and Devart.Data.Oracle.dll are different.

Devart.Data.dll 5.0.134.0
Devart.Data.Oracle.dll 5.70.180.0

Could it be a devart library issue?
It's OK.

Please try using the "Unicode=true;" connection string parameter.
If this doesn't help, tell us:
a) the exact version of your Oracle server;
b) NLS_LANGUAGE, NLS_CHARACTERSET, and NLS_NCHAR_CHARACTERSET of your Oracle server;
c) the regional settings of your machine: Control Panel > Reginal and Language Options > the "Standards and formats" drop-down value, Location, and Language for non-Unicode programs;
d) are you using a Latin symbol 'a' in the sample above?

davidxu
Posts: 3
Joined: Wed 27 Jul 2011 00:41

Post by davidxu » Mon 01 Aug 2011 15:35

Thank you for your reply. I added "Unicode=True;", and test result is the same, i.e., 666 characters was ok, 667 characters failed.

Here are more information about my Oracle server and my test machine.

a) the exact version of your Oracle server;
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

b) NLS_LANGUAGE, NLS_CHARACTERSET, and NLS_NCHAR_CHARACTERSET of your Oracle server;
NLS_LANGUAGE
AMERICAN

NLS_CHARACTERSET
AL32UTF8

NLS_LENGTH_SEMANTICS
BYTE

NLS_NCHAR_CONV_EXCP
FALSE

NLS_NCHAR_CHARACTERSET
AL16UTF16

NLS_RDBMS_VERSION
11.2.0.1.0

c) the regional settings of your machine: Control Panel > Reginal and Language Options > the "Standards and formats" drop-down value, Location, and Language for non-Unicode programs;
My dev machine is a Windows 7 machine. Here are its settings.
Format: English (United States)
Current location: United States
Language for non-unicode program: English (United States)

d) are you using a Latin symbol 'a' in the sample above?
I used ASCII 'a' in the test.

We have a product release in QA regression phase and found this bug. Your quick response is appreciated.

Thanks,
David

pari
Posts: 17
Joined: Thu 27 Nov 2008 12:33

We have the same problem.

Post by pari » Tue 02 Aug 2011 08:23

DataOracle.Version = 6.10.103.0

pari
Posts: 17
Joined: Thu 27 Nov 2008 12:33

Problem resolved.

Post by pari » Tue 02 Aug 2011 10:06

Hi,
after installing the new version (6.30.196.0) this issue is resolved.

Have a nice day, PaRi

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

Post by Shalex » Tue 02 Aug 2011 11:33

We are glad to hear that the issue is solved.

kiachao
Posts: 3
Joined: Wed 31 Oct 2012 03:55
Contact:

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

Post by kiachao » Wed 31 Oct 2012 03:57

pari wrote:Hi,

after installing the new version (6.30.196.0) this issue is resolved.



Have a nice day, PaRi

Can you tell me where to download this version?
My Devart.Data.Oracle.dll is 7.2.104.0
but Devart.Data.dll is 5.0.563.0
Thank you

Helen
Devart Team
Posts: 127
Joined: Wed 07 Sep 2011 11:54

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

Post by Helen » Wed 31 Oct 2012 14:51

dotConnect for Oracle 7.2.104 (includes Devart.Data.dll of the 5.0.563.0 version) can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only) .
To download the licensed version of dotConnect for Oracle 7.2.104 from Registered Users' Area, please use the credentials (URL, account name and password) that were sent to you after the purchase of our product.

Post Reply