Question: I am having trouble making a
table accept Chinese character sets using UTF8. If I am
directly running this insert into Chinese char values('塚') statement
in toad its inserting the value OK, but I cannot do it with Java.
Answer: Sadly, storing Chinese characters
is a nightmare. Chinese is a double-byte
character set, and you need to carefully set-up the NLS parameters
and make sure to use the CHINESE_CHINA.WE8ISO8859P1 character set.
An Oracle character set does not support storing Chinese
characters in a VARCHAR2 column, and you need an NVARCHAR2 column to
store Chinese characters.
This may help, my notes on using the
NLS_LANG parameter.
In windows see NLS_LANG in the registry. The NLS_LANG variable
is in the Home0 directory in the Windows registry is not the only
NLS_LANG, and you need to locate the Oracle directory in the
registry and find NLS_LANG.
This variable may be set to "NA", and a change to
CHINESE_CHINA.WE8ISO8859P1 may fix your issue.
Also see MOSC Note 143783.1 on storing Chinese characters.
In UNIX/Linux, you can set these to whatever you wish'the date
format of the following example is the standard date format used for
recovery, e.g., for UNIX (csh):
> setenv NLS_LANG
CHINESE_CHINA.WE8ISO8859P1
> setenv NLS_DATE_FORMAT 'YYYY-MM-DD:hh24:mi:ss'
Try these setting for inserting Chinese characters:
NLS_CHARACTERSET is UTF8
Client NLS_LANG = UTF8
Client
Region Settings = Simplified Chinese (PRC)
|
|
Get the Complete
Oracle SQL Tuning Information
The landmark book
"Advanced Oracle
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
buy it
for 30% off directly from the publisher.
|