How can an Oracle NUMBER have a Scale larger than the Precision?

前端 未结 6 1961
傲寒
傲寒 2021-01-12 17:39

The documentation states: \"Precision can range from 1 to 38. Scale can range from -84 to 127\".

How can the scale be larger than the precision? Shouldn\'t the Scal

6条回答
  •  鱼传尺愫
    2021-01-12 18:25

    Hmm as I understand the reference the precision is the count of digits.
    maximum precision of 126 binary digits, which is roughly equivalent to 38 decimal digits

    In oracle you have type NUMBER(precision,scale) where precision is total number of digits and scale is number of digits right of decimal point. Scale can be omitted, but it means zero. Precision can be unspecified (use i.e. NUMBER(*,10)) - this means total number of digits is as needed, but there are 10 digits right

    If the scale is less than zero, the value will be rounded to scale digits left the decimal point.
    I think that if you reserve more numbers right of the decimal point than there can be in the whole number, this means something like 0.00000000123456 but I am not 100% sure.

提交回复
热议问题