ORA-12899 / Singlebyte Charset [message #178656] |
Thu, 22 June 2006 02:18 |
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 |
Frank Naude
Messages: 4587 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
|
|
|
|