Search code examples
sqloracle-databaseoracle11goracle12csqldatatypes

Number format issue in Oracle


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');

Solution

  • 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.