Number format issue in Oracle

跟風遠走 提交于 2021-01-29 18:21:59

问题


So i have created a test table having a number column which is of the data type Number(11,8). Now when i am trying to insert the value 13332 in the table it is throwing an oracle error saying:

ORA-01438: value larger than specified precision allowed for this column

I am not sure why. The same works when i am inserting into a column with data type Number(12,6)

INSERT INTO MY_TABLE(COLUMN_1)
values('13332');

回答1:


The reason is - out of 11 digits you have specified 8 digits after decimal places so for the whole number part (before the decimal) you are allowed only 3 digits.

Assuming you want to reserve 8 digits post decimal place in your case it would work if you define the data type as number(13,5) which would allow 5 digits for the whole number.



来源:https://stackoverflow.com/questions/63912589/number-format-issue-in-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!