Search notes:

ORA-06502: PL/SQL: numeric or value error

ORA-06502: number precision too large

The following anonymous PL/SQL block throws a ORA-06502: PL/SQL: numeric or value error: number precision too large error:
declare
    num  number(3) := 1;
begin

    while num < 1000 loop
        dbms_output.put_line('num = ' || num);
        num := num * 2;
    end loop;

end;
/
Compare with ORA-12899: value too large for column … (actual: …, maximum: …)

ORA-06502: character to number conversion error

This block throws a ORA-06502: PL/SQL: numeric or value error: character to number conversion error:
declare
    num  number(3) := 1;
begin
    num := 'abc';
end;
/
Compare with ORA-01722: invalid number

Concatenation

This error is also thrown when concatenating strings with the result of arithemtical expressions:
declare
   n1 number := 7;
   n2 number := 9;
begin
   dbms_output.put_line( n1 || '+' || n2 || '=' ||  n1+n2 ); -- ORA-06502: 
-- dbms_output.put_line( n1 || '+' || n2 || '=' || (n1+n2)); -- Better
end;
/

ORA-06502: character string buffer too small

See also

ORA-06502: hex to raw conversion error

Another subcategory of ORA-06502 is hex to raw conversion error

See also

The predefined exception value_error.
Other Oracle error messages

Index