它的存储方式与 a 相同varchar2
,并且看起来确实是 3 个字节。您可以使用该dump
函数查看它是如何存储的,但clob
您需要提取相关字符(在这种情况下为 3 个字节),例如使用dbms_lob.substr
. 这是来自 Linux 上的 11gR2:
create table t42 (x clob, y varchar2(10));
insert into t42(x, y) values ('€','€');
select dump(dbms_lob.substr(x,3,1)) from t42;
DUMP(DBMS_LOB.SUBSTR(X,3,1))
--------------------------------------------------------------------------------
Typ=1 Len=6: 195,162,194,130,194,172
select dump(y) from t42;
DUMP(Y)
--------------------------------------------------------------------------------
Typ=1 Len=6: 195,162,194,130,194,172
或十六进制:
select dump(dbms_lob.substr(x,3,1),16) from t42;
DUMP(DBMS_LOB.SUBSTR(X,3,1),16)
--------------------------------------------------------------------------------
Typ=1 Len=6: c3,a2,c2,82,c2,ac