PL/SQL (MOSC)

MOSC Banner

ORA-06502 on assignment to number with different precision

edited Dec 5, 2009 3:45AM in PL/SQL (MOSC) 5 commentsAnswered ✓
 Hello, I came around this PL/SQL code that throws ORA-06502 in the second assignment:

    declare
    aa number(4,2);
    bb number(4,3);
    begin
    aa := 57;
    bb := aa;
    end;


When playing with different values of aa, sometimes the exception happens, sometimes not.  I can avoid this error by changing aa into number(4,3) too, but there are many cases in our code where such assignment is done and it worries me. So I'd like to know some guidelines what kinds of numeric assignments are expected to always work and what are not.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center