"ORA-01438:大于该列所允许的指定精度的值"插入3时 [英] "ORA-01438: value larger than specified precision allowed for this column" when inserting 3

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

问题描述

尝试在格式为NUMBER(2,2)的字段中插入除0以外的任何数字时,我遇到了该错误.

I'm running into that error when trying to insert any number except 0 into a field with format NUMBER (2,2).

UPDATE
    PROG_OWN.PROG_TPORCENTAJE_MERMA
SET
    PCT_MERMA = 3
WHERE
    IDN_PORCENTAJE_MERMA = 1

[错误代码:1438,SQL状态:22003] ORA-01438:值大于此列允许的指定精度

[Error Code: 1438, SQL State: 22003] ORA-01438: value larger than specified precision allowed for this column

COLUMN_NAME DATA_TYPE   TYPE_NAME   COLUMN_SIZE   BUFFER_LENGTH   DECIMAL_DIGITS
PCT_MERMA   3           NUMBER      2             0               2

如果我尝试使用十进制数字,也会发生这种情况.

It also happens if I try with decimal numbers.

知道为什么吗?

推荐答案

对于数据类型number(2,2),您不能使用大于1的数字进行更新是因为,第一个参数是数字中的总位数,并且第二个数字(此处为.ie 2)是小数部分的位数.我想您可以插入或更新数据< 1.即0.12、0.95等

You can't update with a number greater than 1 for datatype number(2,2) is because, the first parameter is the total number of digits in the number and the second one (.i.e 2 here) is the number of digits in decimal part. I guess you can insert or update data < 1. i.e. 0.12, 0.95 etc.

请检查 NUMBER数据类型.

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

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