如题,用法上有什么区别?常用哪个,为什么?达人赐教

解决方案 »

  1.   

    The BINARY_INTEGER datatype is identical to PLS_INTEGER. 
    You use the PLS_INTEGER datatype to store signed integers. Its magnitude range is -2147483648 to 2147483647, represented in 32 bits. PLS_INTEGER values require less storage than NUMBER values and NUMBER subtypes. Also, PLS_INTEGER operations use hardware arithmetic, so they are faster than NUMBER operations, which use library arithmetic. For efficiency, use PLS_INTEGER for all calculations that fall within its magnitude range. For calculations outside the range of PLS_INTEGER, you can use the INTEGER datatype.
    binary_integer对应有符号的整数.number可以包含小数点,你可以认为binary_integer是number的子集.
    number(precision,scale),对于binary_integer,不考虑大小取值,他相当于number(precision,0)
      

  2.   

    BINARY_INTENER用来描述不存储在数据库中,但是需要用来计算的带符号的整数值。它以2的补码二进制形式表述。循环计数器经常使用这种类型。NUMBER,是以十进制格式进行存储的,它便于存储,但是在计算上,系统会自动的将它转换成为二进制进行运算的。它的定义方式是NUMBER(P,S),P是精度,最大38位,S是刻度范围,可在-84...127间取值。例如:NUMBER(5,2)可以用来存储表示-999.99...999.99间的数值。P、S可以在定义是省略,例如:NUMBER(5)、NUMBER等;
      

  3.   


    binary_integer 是number的子集吧
    binary_integer 一般用于数组(联合数组)的下标不过现在大部分数值型的数据都差不多用number