Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question.

Asked: November 09, 2011 - 3:58 pm UTC

Last updated: November 16, 2011 - 9:37 am UTC

Version: 10.2

Viewed 10K+ times! This question is

You Asked

Hi Tom - I want to store French characters in my table column .
I insert them through sqlplus but when i select they dont come up correctly. Also when i use sql developer , it works fine
.


SQL> create table t( a varchar2(1000));

Table created.

SQL> insert into t values ('Éé, Eè, Eê, Eë');

1 row created.

SQL> select * from t;

A
--------------------------------------------------------------------------------
--------------------
É┐, E┐, E┐, E┐

SQL> select * from v$nls_parameters;

PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_LANGUAGE
AMERICAN

NLS_TERRITORY
AMERICA

NLS_CURRENCY
$


PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_ISO_CURRENCY
AMERICA

NLS_NUMERIC_CHARACTERS
.,

NLS_CALENDAR
GREGORIAN


PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_DATE_FORMAT
DD-MON-RR

NLS_DATE_LANGUAGE
AMERICAN

NLS_CHARACTERSET
WE8ISO8859P1


PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_SORT
BINARY

NLS_TIME_FORMAT
HH.MI.SSXFF AM

NLS_TIMESTAMP_FORMAT
DD-MON-RR HH.MI.SSXFF AM


PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_TIME_TZ_FORMAT
HH.MI.SSXFF AM TZR

NLS_TIMESTAMP_TZ_FORMAT
DD-MON-RR HH.MI.SSXFF AM TZR

NLS_DUAL_CURRENCY
$


PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_NCHAR_CHARACTERSET
AL16UTF16

NLS_COMP
BINARY

NLS_LENGTH_SEMANTICS
BYTE


PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_NCHAR_CONV_EXCP
FALSE


19 rows selected.
. Please help.

and Tom said...

Look at the NLS_LANG setting of the client - make sure it is set to retrieve french characters.

Look at the *TERMINAL* settings of the client terminal program you are using and make sure it is using a character set to display printed character in french.



Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

A reader, November 14, 2011 - 9:26 am UTC

Hi Tom

What you are saying is these are stored correctly in the database but during retrieval the characters are getting lost.
When i select from the Sql Developer i get the wrong characters.I had this notion that sql developer will select and display exactly what was stored.

Please suggest.
Tom Kyte
November 15, 2011 - 8:44 am UTC

did you check your NLS settings as I said to?


and you know, consistency is relevant:

Also when i use sql developer , it works fine

that is what you originally wrote. Now you have changed your mind?


check the CLIENT NLS_LANG SETTINGS please.

A reader, November 15, 2011 - 4:43 pm UTC

Hi Tom

1. This is what i did and got for nls_lang:
SQL>
SQL> host echo %NLS_LANG%
%NLS_LANG%

2. When i insert and select - both from sql developer ,the string is as it is.But when i insert from sqlplus ( from cmd ) and select from sql developer the problem arises.



- Thanks

Tom Kyte
November 16, 2011 - 9:37 am UTC

1) you are on windows, look in your registry.

2) that indicates to me that you have different character set settings somewhere and there is character set translation taking place. Check your NLS_LANG settings at all points. use dump() to compare the actual bytes being stored from each environment.

NLS_LANG and JDBC

Stew Ashton, November 16, 2011 - 11:26 am UTC


"Starting from Oracle Database 10g, the NLS_LANG variable is no longer part of the JDBC globalization mechanism. The JDBC driver does not check NLS environment. So, setting it has no effect." http://download.oracle.com/docs/cd/E11882_01/java.112/e16548/global.htm In any case, the client character set part would be meaningless since the Java "string" type is always in UTF-16.

Since SQL Developer uses JDBC, the only things to check are on the SQL*Plus side.