user2837961
user2837961

Reputation: 1555

NLS_LANG parameter in Oracle

I have installed oracle with chracterset POLISH_POLAND.EE8MSWIN1250. I can checked the values in select * from nls_database_parameters which are NLS_CHARACTERSET=EE8MSWIN1250 and NLS_NCHAR_CHARACTERSET=AL16UTF16

For sqlplus, I have set NLS_LANG to POLISH_POLAND.EE8PC852. Now I run a sql file from sqlplus command prompt which is saved in "UTF-8 without BOM" as it has polish characters and it works fine. But how do I check if the values are fine in the database?

I have checked in SQL Developer (after setting the NLS_LANG to polish) and they do not look correct. Please help.

Upvotes: 2

Views: 19363

Answers (2)

Codo
Codo

Reputation: 78835

The character set of your Oracle installation is mainly relevant for defining what characters you store. If your client uses a different encoding, Oracle will automatically convert it. If I'm not mistaken, it will even warn you if you try to save a character that's not part of your encoding.

In your case, the main challenge is how to tell SQLplus the encoding of your text file (SQL file). As it is UTF-8, you need to specify a UTF-8 value:

set NLS_LANG=.AL32UTF8

Or:

set NLS_LANG=POLISH_POLAND.UTF8

That should do the trick.

Note that SQLplus does not support UTF-8 with BOM. But this doesn't seem to be relevant for you at the moment.

Upvotes: 5

Wernfried Domscheit
Wernfried Domscheit

Reputation: 59456

NLS_CHARACTERSET just defines how text is binary saved inside Oracle database - and thus also defines characters which are possible to store in DB.

In case your SQL file is UTF-8 it is certainly different to an PC852 or 1250 file. Change your local NLS_LANG to POLISH_POLAND.AL32UTF8 then it should work.

Upvotes: 3

Related Questions