--oracle中有时会遇到中文生僻字显示输入乱码问题
#确认数据库字符集是ZHS16GBK
SQL> SELECT * FROM NLS_DATABASE_PARAMETERS;
PARAMETER VALUE
------------------------------ --------------------------------------------------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET ZHS16GBK
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.2.0.4.0
#确认问题字段类型(varchar2类型无法存储生僻字)
#修改字段类型为nvarchar2
alter table test modify ar_address nvarchar2(150);
对数据操作的时候用unicode转换,根据生僻字到网站查询对应unicode
http://www.bejson.com/convert/unicode_chinese/
测试
update test
set ar_address =
(select utl_raw.cast_to_nvarchar2('4dae') from dual);
SELECT ar_address FROM test;
如果显示有问题在:plsql developer 中在工具--》首选项--》选项中,选中 unicode enable 就可以显示了。