Home > Database > Mysql Tutorial > oracle开发技术:溢出错误解决方法

oracle开发技术:溢出错误解决方法

WBOY
Release: 2016-06-07 16:21:47
Original
1048 people have browsed it

Oracle 数值数据类型最多可存储 38 个字节的精度。当将 Oracle 数值转换 为公共语言运行库数据类型时,小数点后边的位数可能过多,这会导致此错误。 解决方法: 使用round()函数: 例如:select min(pval),max(pval),round(avg(pval),5) from hvm_data_dga .

  Oracle 数值数据类型最多可存储 38 个字节的精度。当将 Oracle 数值转换

  为公共语言运行库数据类型时,小数点后边的位数可能过多,,这会导致此错误。

  解决方法:

  使用round()函数:

  例如:select min(pval),max(pval),round(avg(pval),5) from hvm_data_dga .

  round(avg(pval),5) 使数值小数点后按照四舍五入保留5位。

  select round(32/14, 3) from dual;

  输出结果:2.286

  select round(32/14, 2) from dual;

  输出结果:2.29

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template