Click here to Skip to main content
13,086,662 members (55,461 online)
Rate this:
Please Sign up or sign in to vote.
See more:

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,
Posted 4-Oct-12 8:31am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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:[^].

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:[^],[^],[^],[^],[^],[^].

Good luck,
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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[^].

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 5 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100