参见我在Oracle数据库上将一个特殊字符“临时”插入到我的表中:
INSERT INTO ABBREV (ABBREV, DEFINITION) VALUES ('µg','microgram (one millionth of a gram, 10-6 gram)');
INSERT INTO ABBREV (ABBREV, DEFINITION) VALUES ('µmole','micromole');
当我选择我得到的数据时:
SQL> select * from ABBREV where DEFINITION like '%micro%';
ABBREV DEFINITION
------------------------------ --------------------------------------------------------------------------------
omi other micro-organisms
¿µg microgram (one millionth of a gram, 10 -6 gram)
¿µmole micromole
SQL>
为什么我在“扩展”之前加上“”,以及如何在insert语句中避免它?
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
NLS_NCHAR_CHARACTERSET AL16UTF16
发布于 2015-03-17 07:07:19
要想找到合适的解决方案,您必须根据本地代码页设置NLS_LANG
环境变量。
看起来是这样的:
C:\>chcp
Active code page: 850
C:\>set NLS_LANG=.WE8PC850
C:\>sqlplus ...
SQL> INSERT INTO ABBREV (ABBREV, DEFINITION) VALUES ('µmole','micromole');
1 row created.
SQL>
另一个解决方案是使用函数UNISTR
。
INSERT INTO ABBREV (ABBREV, DEFINITION) VALUES (UNISTR('\00B5mole'),'micromole');
https://stackoverflow.com/questions/29080372
复制相似问题