ORA-01438:大于指定精度的值允许该列 [英] ORA-01438: value larger than specified precision allows for this column

查看:228
本文介绍了ORA-01438:大于指定精度的值允许该列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时我们会从合作伙伴的数据库中收到以下错误消息:

We get sometimes the following error from our partner's database:

<i>ORA-01438: value larger than specified precision allows for this column</i>

完整的响应如下所示:

<?xml version="1.0" encoding="windows-1251"?>
<response>
  <status_code></status_code>
  <error_text>ORA-01438: value larger than specified precision allows for this column ORA-06512: at &quot;UMAIN.PAY_NET_V1_PKG&quot;, line 176 ORA-06512: at line 1</error_text>
  <pay_id>5592988</pay_id>
  <time_stamp></time_stamp>
</response>

此错误的原因是什么?

推荐答案

您要存储的数字对于该字段而言太大.看一下标度和精度.两者之间的区别是可以存储的小数点前的位数.

The number you are trying to store is too big for the field. Look at the SCALE and PRECISION. The difference between the two is the number of digits ahead of the decimal place that you can store.

select cast (10 as number(1,2)) from dual
             *
ERROR at line 1:
ORA-01438: value larger than specified precision allowed for this column

select cast (15.33 as number(3,2)) from dual
             *
ERROR at line 1:
ORA-01438: value larger than specified precision allowed for this column

低端的所有内容均被截断(无提示)

Anything at the lower end gets truncated (silently)

select cast (5.33333333 as number(3,2)) from dual;
CAST(5.33333333ASNUMBER(3,2))
-----------------------------
                         5.33

这篇关于ORA-01438:大于指定精度的值允许该列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆