标签:
宋体字符集汉字暗示存储 |
分类: ORACLE |
SQL> /
VALUE
----------------------------------------------------------------
UTF8
SQL> select dump('汉') from dual;
DUMP('汉')
--------------------------------------------------
Typ=96 Len=3: 230,177,137
SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options 断开
C:\>set NLS_LANG=AMERICAN_AMERICA.UTF8
C:\>sqlplus "/ as sysdba"
SQL*Plus: Release 10.1.0.2.0 - Production on Tue Apr 8 11:24:39 2008
Copyright (c)
1982, 2004, Oracle.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select dump('汉') from dual;
DUMP('汉')
---------------------
Typ=96 Len=2: 186,186
SQL> select lengthb('汉') from dual;
LENGTHB('汉')
-------------
SQL> create table wwm (name char(4));
Table created.
SQL> insert into wwm values ('汉字');
1 row created.
SQL> select * from wwm;
NAME
----
汉字
也就是说,你暗示ORACLE你的环境和ORACLE里的字符集一致。ORACLE就直接保存你输入的东西,而不会把输入转成UTF8
C:\>set NLS_LANG=AMERICAN_AMERICA.zhs16gbk
C:\>sqlplus "/ as sysdba"
SQL*Plus: Release 10.1.0.2.0 - Production on Tue Apr 8 11:42:43 2008
Copyright (c)
1982, 2004, Oracle.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from wwm;
NAME
--------
???
SQL> select dump(name) from wwm;
DUMP(NAME)
-------------------------------------------------------------------------------
Typ=96 Len=4: 186,186,215,214

加载中…