博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
NUMBER Data Type
阅读量:4196 次
发布时间:2019-05-26

本文共 2621 字,大约阅读时间需要 8 分钟。

The NUMBER data type stores zero as well as positive正数 and negative负数 fixed numbers withabsolute values绝对值 from 1.0 x 10-130 to but not including 1.0 x 10126. If you specify指定 anarithmetic expression算术表达式 whose value has an absolute value greater较大 than or equal to 1.0 x 10126, then Oracle returns an error. Each每个 NUMBER value requires需要 from 1 to 22 bytes.

Specify指定 a fixed-point number using the following form:

NUMBER(p,s)

where:

  • p is the precision精度, or the maximum number of significant decimal digits有效小数位数, where the most significant digit有效位 is the left-most nonzero digit非零位, andthe least significant digit最低有效位 is the right-most known digit数字. Oracleguarantees保证 the portability of可移植性 numbers with precision精度 of up to 20 base-100 digits, which is equivalent相等的 to 39 or 40 decimal小数 digits depending on theposition of位置 the decimal point.

  • s is the scale标度, or the number of digits from the decimal point to the least significant digit. The scale标度can range from -84 to 127.

    • Positive正数 scale is the number of significant digits有效位 to the right of the decimal point to and including the least significant digit.

    • Negative负数 scale is the number of significant digits to the left of the decimal小数point, to but not including the least significant digit. For negative负数 scale the least significant digit is on the left side左边 of the decimal point, because theactual实际 data is rounded全面 to the specified指定 number of places to the left of the decimal point. For example, a specification规格 of (10,-2) means to round tohundreds百位.

Scale标度 can be greater than precision精度, most commonly通常 when e notation注释 is used. When scale is greater than precision, the precision specifies指定 the maximum number ofsignificant digits有效位 to the right of the decimal point. For example, a column defined定义as NUMBER(4,5) requires需要 a zero for the first digit数字 after the decimal point and rounds all values past the fifth digit过五位数 after the decimal point.

It is good practice练习 to specify指定 the scale and precision精度 of a fixed-point number column for extra integrity额外的完整性 checking on input. Specifying指定 scale and precision does not force all values to a fixed length. If a value exceeds the precision, then Oracle returns an error. If a value exceeds超过 the scale, then Oracle rounds it.

Specify指定 an integer整数 using the following form:

NUMBER(p)

This represents代表 a fixed-point number with precision p and scale 0 and is equivalent相等的to NUMBER(p,0).

Specify指定 a floating-point number using the following form:

NUMBER

The absence没有 of precision and scale designators specifies指定 the maximum range and precision for an Oracle number.

转载地址:http://thzli.baihongyu.com/

你可能感兴趣的文章
【Git+Source Tree使用教程之一】commit & push
查看>>
C#和.NET框架和术语
查看>>
【React Native】把现代web科技带给移动开发者(一)
查看>>
【GoLang】Web工作方式
查看>>
Launch Sublime Text 3 from the command line
查看>>
【数据库之mysql】mysql的安装(一)
查看>>
【数据库之mysql】 mysql 入门教程(二)
查看>>
【HTML5/CSS/JS】A list of Font Awesome icons and their CSS content values(一)
查看>>
【HTML5/CSS/JS】<br>与<p>标签区别(二)
查看>>
【HTML5/CSS/JS】开发跨平台应用工具的选择(三)
查看>>
【心灵鸡汤】Give it five minutes不要让一个好主意随风而去
查看>>
【React Native】Invariant Violation: Application AwesomeProject has not been registered
查看>>
【ReactNative】真机上无法调试 could not connect to development server
查看>>
【ReactNative/JS】uint8array转string convert uint8array to string
查看>>
【XCode 4.6】常用快捷键 特别是格式化代码ctrl+i
查看>>
【iOS游戏开发】icon那点事 之 实际应用(二)
查看>>
【iOS游戏开发】icon那点事 之 图标设计(三)
查看>>
【IOS游戏开发】之测试发布(Distribution)
查看>>
【IOS游戏开发】之IPA破解原理
查看>>
【一天一道LeetCode】#45. Jump Game II
查看>>