RE: NLS question

  • From: "Martin Busik" <martin.busik@xxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Sun, 13 Mar 2011 22:26:47 +0100

>Developer creates a table with nvarchar2(1000) column and tries to insert a
ó
>into that column.
>
>Create table my_table(col1 nvarchar2(1000));
>Insert into my_table values ('Acadó');

A single quoted string is of type CHAR, not NCHAR.

You have to write: insert into my_table values ( N'Acadó').

N'...' means a NCHAR string.

While omitting the "N", oracle converts the input to US7ASCII, efectively
replacing
all non-ascii characters (e.g. all characters with accents) with a
replacement
character (~ decimal 127, I think).

Then occours a CHAR -> NCHAR conversion. But in that step, your accents were
already eliminated...


> NLS_CHARACTERSET=US7ASCII means 256 characters see
http://www.asciitable.com/

this is wrong. It means, 256 characters could be stored (and converted from
and to other character sets),
but the "defined" characters of the US7ASCII endoding are less than 128, see
Table 2-2 at:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch2charset.ht
m

Cheers,
Martin

--
//www.freelists.org/webpage/oracle-l


Other related posts: