“ORA-01438: value larger than specified precision allowed for this column” when inserting 3

后端 未结 2 1242
走了就别回头了
走了就别回头了 2020-12-06 05:05

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
         


        
相关标签:
2条回答
  • 2020-12-06 05:27

    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.

    Please check NUMBER DATATYPE in NUMBER Datatype.

    0 讨论(0)
  • 2020-12-06 05:28

    NUMBER (precision, scale) means precision number of total digits, of which scale digits are right of the decimal point.

    NUMBER(2,2) in other words means a number with 2 digits, both of which are decimals. You may mean to use NUMBER(4,2) to get 4 digits, of which 2 are decimals. Currently you can just insert values with a zero integer part.

    More info at the Oracle docs.

    0 讨论(0)
提交回复
热议问题