我理解数字数据类型的概念,并通过本页01/server.111/b28318/datatype.htm#i22289的信息得到了认可。
然而,看起来我仍然错过了一些东西,因为我真的不明白为什么我要得到这个错误ORA-01438。
select cast (18000.0 as number(11,7)) from dual;结果在
ORA-01438: value larger than specified precision allowed for this column
01438. 00000 - "value larger than specified precision allowed for this column"
*Cause: When inserting or updating records, a numeric value was entered
that exceeded the precision defined for the column.
*Action: Enter a value that complies with the numeric column's precision,
or use the MODIFY option with the ALTER TABLE command to expand
the precision.同时将规模从7降到6,作为一种魅力。
select cast (18000.0 as number(11,6)) from dual;这发生在“Oracle数据库11g企业版发布版11.2.0.4.0 -64位生产”中。
有人能告诉我为什么会发生这种事吗。
谢谢你,谢谢你的帮助。
发布于 2016-06-17 12:16:13
number(11,7)允许总为11位和7位小数位的数字。这就意味着你有11-7=4个非小数位数。
18000作为五个非小数位数,这是一个太多。
https://stackoverflow.com/questions/37881285
复制相似问题