numeric or value error: character string buffer too small

时间:2021-09-08 20:22:26

I got a problem with scared me a lot at my first sight, "numeric or value error : charactor string buffer too small".

because of "buffer", it seems a very hard issue, I can not find any questionable code , I turn to SP,

 

CREATE OR REPLACE PROCEDURE P_IC_USERS_S
(
......
cur_out OUT PKG_IC_CURSOR.REF_CURSOR
)

AS
v_count number :=0;
v_name varchar2(50);
BEGIN
SELECT COUNT(1) INTO v_count FROM .......;

IF v_count>0 THEN
select p.name into v_name from t_ic_profile p where...................;
END IF;

............................
END P_DM_IC_USERS_S;

 

the Chinese used to name ourselves within two or three words, so we are apt to think 50 is a big enough length for a variable for NAME fields , how ever , this time ,the guy's name longer than 50, so I got that scary exception....

 

 

solution: easy, give it a biger length is ok .