oracle 数据类型

32
Oracle 数数数数 数数数 Alibaba-inc 2010-05 http://blog.csdn.net/yzsind

Upload: yzsind

Post on 31-May-2015

2.301 views

Category:

Technology


8 download

DESCRIPTION

Oracle 数据类型分享

TRANSCRIPT

  • 1. Oracle

    Alibaba-inc
    2010-05
    http://blog.csdn.net/yzsind

2.
(NUMBER)
(STRING)
(DATETIME)
(LOB)
3.
NUMBER(p,s)
p:+ 1-38
s:-47-127
Number(6,2)6422
Number(6,-2)???
Number(1,-2)??? 949,950
DATA_LENGTH===22???
4. Number
1-21
01(0x80)
12(0xC1,0x02)
-13(0x3E,0x64,0x66)
SQL> select dump(123456789,16) from dual;
DUMP(123456789,16)
-----------------------------
Typ=2 Len=6: c5,2,18,2e,44,5a
5. unDumpNumber
if Bytes(0) = 128 then --1280
result := 0;
elsif Bytes(0) > 128 then --128
for i in 1 .. vlength - 1 loop
result := result +
(Bytes(i) - 1) * power(100, (Bytes(0) - 193) - i+1);
end loop;
else --128
for i in 1 .. vlength - 2 loop --102
result := result +
(Bytes(i) - 101) * power(100, (62 - Bytes(0)) - i+1);
end loop;
end if;
return(Result);
6. (10g)
BINARY_FLOAT
4
BINARY_DOUBLE
8

7. Number VS Binary_Float
insert into t(c_number,c_float) select rownum/100,rownum/100 from dual connect by rownum