Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Precesion and lenghth related query- Data Type Number(22,2)

Hello Experts,
I have amount column in my table with data type number(22,2):
image.png
However it allows only values with 10 digit like below:

update XYZ.Table1
set amount=9999999999
127 rows updated.
However it does not allow below:
update XYZ.Table1
set amount=99999999999

Error report -
SQL Error: 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.

I assumed that number(22,2) data type will allow me 22 disgit number, which does not seem to be correct.
Any idea how do precesion and lenghth work?

Thanks,
Rajneesh

This post has been answered by Jonathan Lewis on Oct 15 2020
Jump to Answer
Comments
Post Details
Added on Oct 15 2020
2 comments
3,600 views