• OCI22053: 溢出错误的原因和解决方法


    Oracle 数值数据类型最多可存储 38 个字节的精度。
    当将 Oracle 数值转换为公共语言运行库数据类型时,
    Oracle 值可能会变得过大。这会导致 Oracle OCI-22053 溢出错误。

    解决方法是用round函数。

    如何使用 Oracle Round 函數 (四捨五入)

     

    描述 : 傳回一個數值,該數值是按照指定的小數位元數進行四捨五入運算的結果。

     

    SELECT ROUND( number, [ decimal_places ] ) FROM DUAL

     

    參數:

    number : 欲處理之數值

    decimal_places : 四捨五入 , 小數取幾位 ( 預設為 0 )

     

    Sample :

     

    select round(123.456) from dual;              回傳 123

    select round(123.456, 0) from dual;          回傳 123

    select round(123.456, 1) from dual;          回傳 123.5

    select round(123.456, 2) from dual;          回傳 123.46

    select round(123.456, 3) from dual;          回傳 123.456

    select round(-123.456, 2) from dual;        回傳 -123.46

  • 相关阅读:
    ElasticSearch-03-远行、停止
    ElasticSearch-02-elasticsearch.yaml
    Go-31-杂序
    Go-30-main包
    SpringBoot 初入门
    Spring 事务管理
    JDBC Template
    Spring 基于 AspectJ 的 AOP 开发
    Spring AOP 代理
    Spring 的 AOP 概述和底层实现
  • 原文地址:https://www.cnblogs.com/jackhuclan/p/1332575.html
Copyright © 2020-2023  润新知