number(p,s)在oracle中p与s的意思 r.s.v.p是什么意思

主要是在Oracle中经常会遇到的问题的一个总结.
在oracle中number表示数据型,p=>pricesion,s=>scale.在oracle管方网站上对number(p,s),作以下的解释:

//==============================================================================================//

TheNUMBERdatatypestores zero as well as positive and negative fixed numbers withabsolute values from 1.0 x 10-130to(but not including) 1.0 x 10126. If you specify anarithmetic expression whose value has an absolute value greaterthan or equal to 1.0 x 10126, then Oracle returns anerror. EachNUMBERvaluerequires from 1 to 22 bytes.

Specify a fixed-point number using the following form:

NUMBER(p,s)

where:

Scale can be greater thanprecision, most commonly whenenotationis used. When scale is greater than precision, the precisionspecifies the maximum number of significant digits to the right ofthe decimal point. For example, a column definedasNUMBER(4,5)requiresa zero for the first digit after the decimal point and rounds allvalues past the fifth digit after the decimal point.

It isgood practice to specify the scale and precision of a fixed-pointnumber column for extra integrity checking on input. Specifyingscale and precision does not force all values to a fixed length. Ifa value exceeds the precision, then Oracle returns an error. If avalue exceeds the scale, then Oracle rounds it.
//=========================================================================//
太长了,看不是太懂.
总结一下:
1,范围:number(p,s)
a,p在1~38,s在-84~127
2,p>s时:
a,s>0时:
数据的有效数字为p个,小数部分为s个,整数部分为p-s个
如果整数大于p-s时,报错;
如果小数部分大于s,会对小数部分四舍五入,最后变成s.
b,s=0时:表示这个没有小数的数(可以理解为整形)
number(p,s)在oracle中p与s的意思 r.s.v.p是什么意思
c,s<0时:表示这个是整形(没有小数位)
从小数点左起每|s|个位进行四舍五入,
然后整数的有效位数为p+|s|位,如果整数的数据大于p+|s|时,会报错.
3,p<s时:表示的范围在0~1之间
a,小数起必须要存在s-p个0,如果不够,会报错;
b,小数位数大于s,会自动四舍五入;

参考一下:http://hi.baidu.com/mars_mars/blog/item/6154198083d989d2bd3e1eae.html
http://www.cnblogs.com/hengzi/archive/2011/08/17/Oracle-10g-datatype.html

  

爱华网本文地址 » http://www.aihuau.com/a/25101012/113578.html

更多阅读

在ppt中加入背景音乐的方法 听了让人热血沸腾的歌

在ppt中加入背景音乐的方法——简介有时候为了能让ppt的效果更好,我们需要在其中加入一些背景音乐渲染气氛。在ppt中加入背景音乐的方法——方法/步骤在ppt中加入背景音乐的方法 1、打开一个ppt在ppt中加入背景音乐的方法 2、点击

最快在Excel中输入学生成绩的方法 键盘输入10个学生成绩

最快在Excel中输入学生成绩的方法实际上最快速的录入方法应该是按试卷的顺序在Excel中逐个输入学号和分数,由电脑按学号把成绩填入成绩表相应学生的记录行中。需要输入成绩时,先单击Excel表格的J1后的下拉按钮,从下拉列表中选择要输入

在PS中抠图常用的方法技巧总结 – 人人分享 钢笔抠图技巧

在PS中抠图常用的方法技巧总结来源: 庄巍ヤ.oKīSS的日志一、用背景橡皮擦抠图打开方法:工具栏——橡皮擦工具——背景橡皮擦用途:无论主体边缘多么复杂,只要与背景有显著的色彩或亮度的差别,背景橡皮擦就是个好工具基本操作:背景橡皮擦是

声明:《number(p,s)在oracle中p与s的意思 r.s.v.p是什么意思》为网友社会渣子分享!如侵犯到您的合法权益请联系我们删除