Home » Infrastructure » Windows » ORA-12899 / Singlebyte Charset
ORA-12899 / Singlebyte Charset [message #178656] Thu, 22 June 2006 02:18 Go to next message
marcom
Messages: 3
Registered: June 2006
Location: Germany
Junior Member
Hi everyone!

First of all I would like to say that I am pretty new to oracle, so my error may be very straightforward. I hope that this is the correct place to post my question.

Anyway, here is what I am trying to do:

I want to convert an old database (pervasive) into an oracle database. I wrote my own program (C#, .Net 2.0) that reads DB1 and writes into DB2 (Oracle).
My source table has a text column which is 40 bytes long. The stored data is in OEM. I want to convert this text into ANSI and then write it into the new table on the oracle DB. As ANSI aswell as OEM are singlebyte, I allocate 40 bytes for the column on the oracle DB. Everything goes well but as soon as there is a special character (say "", "", "", "" etc...) I get an exception "ORA-12899" stating that my string is too long. I have the feeling that the character is interpreted as doublebyte for some reason (although my debugger tells me that my string is exactly 40 byte long, and the datatype is set to ANSISTRING). Basically I can enter 40 "a"'s into the table, but as soon as I have a "" oracle complains that the length of the data I am trying to enter is 41 bytes.
I know that I can allocate the column by using "CHAR(40 CHAR)" but this allocates 80 bytes. The length has to be exactly 40 bytes otherwise our applications that read the DB will not function correctly.
I tried connecting through two types of providers:
ODBC and OracleClient.

Thanks for any hints!

Kind regards,

Mark
Re: ORA-12899 / Singlebyte Charset [message #178710 is a reply to message #178656] Thu, 22 June 2006 04:51 Go to previous messageGo to next message
Frank Naude
Messages: 4570
Registered: April 1998
Senior Member
What character set are you using on the database?

SQL> SELECT * FROM nls_database_parameters WHERE parameter LIKE '%CHARACTERSET%';

PARAMETER                      VALUE
------------------------------ ----------------------------------------
NLS_CHARACTERSET               WE8ISO8859P1
NLS_NCHAR_CHARACTERSET         AL16UTF16
Re: ORA-12899 / Singlebyte Charset [message #178745 is a reply to message #178656] Thu, 22 June 2006 07:42 Go to previous message
marcom
Messages: 3
Registered: June 2006
Location: Germany
Junior Member
Hi Frank,

Thankyou very much! That was indeed the culprit - the CharSet was set to AL32UTF8.

Take care,

Mark
Previous Topic: Connection issues through RMAN
Next Topic: System error 998 - Oracle ODBC Driver issue
Goto Forum:
  


Current Time: Fri Oct 15 21:41:19 CDT 2021