OracleRef

MenuMenu

Home Home
Contact Contact

Loading

ORA-06442 ORA-06442


ORA-06443 ORA-06443


ORA-06444 ORA-06444


ORA-06445 ORA-06445


ORA-06446 ORA-06446


ORA-06447 ORA-06447


ORA-06448 ORA-06448


ORA-06449 ORA-06449


ORA-06500 ORA-06500


ORA-06501 ORA-06501


ORA-06503 ORA-06503


ORA-06504 ORA-06504


ORA-06505 ORA-06505


ORA-06508 ORA-06508


ORA-06509 ORA-06509


ORA-06510 ORA-06510


ORA-06511 ORA-06511


ORA-06512 ORA-06512


ORA-06513 ORA-06513


ORA-06514 ORA-06514




 
ORA-06502

 ORA-06502

Share

Title :

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





Cause :
An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).

Action :
Change the data, how it is manipulated, or how it is declared so that values do not violate constraints.




 
 
2011-04-04 09:24:51: Emilien
2 examples:

Example 1:
declare
   v_my_number number(2);
begin
   v_my_number := 100;
end;
 
 
You would receive the following error message:
 

ORA-06502

: PL/SQL: numeric or value error: number precision too large

ORA-06512

: at line 4
 
 
You've tried to assign a 3 digit number to a variable called v_my_number that can only handle 2 digits. You could correct this error by redefining the v_my_number variable as number(3).

Action:
declare
   v_my_number number(3);
begin
   v_my_number := 100;
end;
 
 
Example 2:
declare
   v_my_number number(2);
begin
   v_my_number := 'a';
end;
 
 
You would receive the following error message:
 

ORA-06502

: PL/SQL: numeric or value error: character to number conversion error

ORA-06512

: at line 4
 
 
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_my_number a proper numeric value.

Pseudo:

Comment:
CAPTCHA Image


Reload Captcha Image
Enter Code Below
 

Copyright © 2009-2014 OracleRef