SQL Language (MOSC)

MOSC Banner

I (uppercase) with dot above, cause ORA-06502: PL/SQL: numeric or value error: character string buff

edited Jun 27, 2014 7:08PM in SQL Language (MOSC) 2 commentsAnswered

We hit error "ORA-06502: PL/SQL: numeric or value error: character string buffer too small" when we do the following:

declare

i number;

v varchar2(30);

v1 varchar2(200);

begin

i:=0;

v1:='AAAAAAA AAİAİA AA AAAAAAAAA AAAAAAAAİ';

dbms_output.put_line(length(v1)||' '||v1);

v:=substr(v1, 1, 28)||' '||to_char(i);

dbms_output.put_line(length(v)||' '||v);

end;

however, if we change the v to varchar2(32), it will be success, but the final length of v is 30.

so what wrong when we declare only  varchar2(30), but the system throw us the error, but in fact it is only 30 characters?

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