Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hello,

I have 2 tables A and B.
Both of them have a field varchar2(55), named for example "address".
A.address contains cyrillic characters inserted from a mapper application.
During the flow, I need to select data from A.address and insert in B.address.

For an unknown reason, my statement return an error which said that the maximul lenght exceeded in B.address during the insertion.

Does anyone know why it is happening?

thanks a lot,
mikcutu.
Posted

The problem is that you are not using data types supporting Unicode.

My guess is that you might have created the situation where you feed Unicode to Oracle, bytewise, and Oracle tries to interpret the bytes as separate characters. As Cyrillic code points get more then one bytes each with any of the UTFs, the total number of these misinterpreted "characters" exceeds 55. Are you getting the idea.

You can fix this by using data types supporting Unicode; varchar can be replaced with Unicode NVARCHAR2. Please see:
http://docs.oracle.com/cd/B19306_01/server.102/b14225/ch7progrunicode.htm[^].

It's also good to understand what Unicode is — there are too many myths around adopted by too many developers. In particular, this is not a 16-bit encoding. This is not the encoding at all, UTFs are. Please see:
http://en.wikipedia.org/wiki/Unicode[^],
http://unicode.org/[^],
http://en.wikipedia.org/wiki/Code_point[^],
http://en.wikipedia.org/wiki/Byte_order_mark[^],
http://en.wikipedia.org/wiki/UTF[^],
http://unicode.org/faq/utf_bom.html[^].

Good luck,
—SA
 
Share this answer
 
While agreeing with SA, I might add that Oracle of course works with cyrillic characters, if set up properly.
Check the NLS_LANG settings on the server AND the client that they support the language you use.
Note that the Server and the clients need to have the same setting and that you can't really change the setting on the server after installation while the NLS_LANG settings affects the tables on file level.
The best NLS_LANG setting is of course to use one of the UNICODE settings and not some national codepage, that would effectively turn varchar2 into nvarchar2.

More on NLS_LANG here[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900