ORA-06502 PL/SQL: numeric or value error
This error message is very tricky. Here, you can learn how to solve it.
- The main cause that produces this message is that you are assigning a value NULL to a variable that does not admit it.
- Another possible cause is that you are assigning a number to a variable and its size is to small to hold that value.
- Sometimes, you get that error message when you concatenate two strings and the result is assigned to a variable too small.
DECLARE
N1 number(2) NOT NULL :=20;
N2 number(2);
BEGIN
N1 := N2;
END;
DECLARE
N NUMBER(2);
BEGIN
N:= 100;
END;
DECLARE
C1 varchar2(10) ;
C2 varchar2(7);
BEGIN
C1:=’This is an’;
C2:=’ error.’
C1 :=C1||C2 ;
END;