ORA-06502: PL/SQL: numeric or value error
ORA-06502: PL/SQL: numeric or value error
You tried to tried to execute a statement that resulted in an arithmetic, numeric, string, conversion, or constraint error. This error can be caused by many circumstances. The following are two examples of how to resolve this Oracle error:
This error occurs when you try to assign a value to a numeric variable, but the value is larger than the variable can handle.
For example, if you had the following PLSQL code:
DECLARE v_number number(2); BEGIN v_number := 100; END;
You've tried to assign a 3 digit number to a variable called v_number that can only handle 2 digits. You could correct this error by redefining the v_number variable as number(3).
DECLARE v_number number(3); BEGIN v_number := 100; END;
This error also occurs if you are trying to assign a non-numeric value to a numeric variable.
For example, if you had the following PLSQL code:
DECLARE v_number number(2); BEGIN v_number := 'a'; END;
In this example, the value of 'a' does not properly convert to a numeric value. You can correct this error by assigning the variable called v_number a proper numeric value.