-- pmx.sql: the largest value a NUMBER(p) column accepts -- Copyright (c) HASHJOIN. MIT License (https://hashjoin.com/kb/license/) -- https://hashjoin.com/kb/oracle/number-precision-max-value/ -- -- Usage: @pmx.sql -- @pmx.sql 10 9999999999 col max_value format 999999999999999999999999999999999999999999999999999999999 select to_number(rpad('1',&&1+1,'0'))-1 max_value from dual /