Search code examples
oraclesqldatatypes

Oracle NUMBER data type max limit with & without decimal points


I have a number field in the application which passes a numeric value to my Oracle procedure which is of NUMBER datatype. The numeric value can be positive, negative, with or without decimal points.

I need to restrict it from the application so I need to specify the maximum limit without any round-off. Can I please know what will be the limits for positive, negative, with, and without decimals points.


Solution

  • It is not really a range that is allowed, but a precision. You can pass any number with up to 38 digits, no matter if or where the decimal separator.

    Okay:

    +12345678901234567890123456789012345678
    -12345678901234567890123456789012345678
    +1.2345678901234567890123456789012345678
    -1234567890123456789012345678901234567.8
    

    May get slightly mutilated:

    +123456789012345678901234567890123456789
    -123456789012345678901234567890123456789
    +1.23456789012345678901234567890123456789
    -1234567890123456789012345678901234567.89
    

    Demo with some longer numbers: https://dbfiddle.uk/?rdbms=oracle_18&fiddle=aa74ef09157dcf86daa76507e868fe49