Strange exception in Array binding mode.

Strange exception in Array binding mode.

Postby Leonid » Wed 05 Jul 2006 14:21

I found exception when I made some changes in example "OraDirect .NET demo - using array bind operations" that I'd got with trial version of OraDirect components. Our Oracle database works with UTF-8 dataset so I changed OraConnection parameter Unicode to true. During execution insert to the demo table DEPT:
oraUpdateCommand.Parameters["deptno_p"].Value = deptnoArr;
oraUpdateCommand.Parameters["dname_p"].Value = dnameArr;
oraUpdateCommand.ExecuteArray(recCount);

where oraCommand.Text = INSERT INTO DEPT ( DEPTNO, DNAME)
VALUES ( :deptno_p, :dname_p)
I 'd recieve an exception with message "ORA-01461: can bind a LONG value only for insert into a LONG column".
When OraConnection.Unicode = false - everything works fine.
When OraConnection.Unicode = false but i am inserting only 1 row with
oraUpdateCommand.ExecuteNonQuery everything work.

So, what is my problem?
Best, regards Leonid.
Leonid
 
Posts: 24
Joined: Wed 26 Oct 2005 12:59

Postby Leonid » Wed 05 Jul 2006 15:38

Some additional info.
I am trying to insert to Oracle database some Japanese text. In case when OraConnection.Unicode=false I have no exception but in DB inserted some ASCI string and then i cann't read japanese from DB. When OraConnection.Unicode=false the occurs same exception "ORA-01461: can bind a LONG value only for insert into a LONG column".
Leonid
 
Posts: 24
Joined: Wed 26 Oct 2005 12:59

Postby Paul » Fri 07 Jul 2006 08:09

Do you work with Oracle client or in Direct=true mode? What is a value of NLS_LANG parameter in Oracle client (See it in registry HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME)?
This parameter is importent if you use Oracle client with Unicode=false. Windows charset must be compartible with NLS_LANG
We cannot reproduce your problem with Unicode=true (Direct=true or Direct=false). Please check that VARCHAR field have enough capacity to store 3 bytes for every character.
Paul
 
Posts: 725
Joined: Thu 28 Oct 2004 14:06


Return to dotConnect for Oracle