通常对dump出来的内容,不能直观了解到想要的信息。可以用utl_raw来实现。 1 转换数字1.1 整数SQL> select dump(175185, 16) from dual;DUMP(175185,16)
+ Y: A( U( X3 V! o$ p1 |# ^4 V3 J------------------------' [6 f7 [6 r; M. b2 b8 j* v5 ]0 E
Typ=2 Len=4: c3,12,34,56 SQL> select utl_raw.cast_to_number('c3123456') value from dual;VALUE# A7 p/ _' m4 I$ g4 P
----------
) w4 v6 r) X# l* C 175185加个replace函数处理起来更方便。" v, t! a9 h2 G' ~6 R
SQL> select utl_raw.cast_to_number(replace('c3,12,34,56', ',')) value from dual;VALUE
9 \/ n$ m1 v( ~7 }----------4 s, M8 X" _. b) l( N7 V8 v; \+ A
175185 1.2 小数SQL> select dump(1751.85, 16) from dual;DUMP(1751.85,16)
# _. g- p; o- r0 W, U0 d------------------------- x9 g" L. a: G# K, U4 e
Typ=2 Len=4: c2,12,34,56 SQL> select utl_raw.cast_to_number(replace('c2,12,34,56', ',')) value from dual;VALUE
- ]7 n9 _9 v+ }----------
6 {% C. }0 q' s: N' c 1751.85 2 转换字符串SQL> select dump('oracle tom', 16) a from dual;a' N; {5 V% T- G1 Z9 c1 v6 _7 {% E
--------------------------------------------
' Z) b$ R2 Q6 \4 `' \4 b Typ=96 Len=10: 6f,72,61,63,6c,65,20,74,6f,6d SQL> select utl_raw.cast_to_varchar2(replace('6f,72,61,63,6c,65,20,74,6f,6d', ',')) value from dual;VALUE
. N+ y( I5 ?5 j& r9 d--------------------------------------------------------------------------------3 C3 ]$ e' G! R( @9 w! Q# d' e) t
oracle tom |