1

Topic: Advise about exception in PL/SQL on ORA-06502 (character string buffer too small)

All greetings.
There is a procedure from the old project of which it is not possible to get rid in any way for the bureaucratic reasons, approximately here such type (all insignificant threw out).

CREATE OR REPLACE PROCEDURE <name> (..., o_res out number, o_msg out varchar2) is
l_line varchar2 (255): = ' declare ';
...
begin
-- Unconditionally we quit procedure
l_line: = ' begin1 ';
o_res: = 0;
l_line: = ' begin2 ';
o_msg: ='OK ';
l_line: = ' begin3 ';
RETURN;
l_line: = ' 0 ';
<......>
l_line: = ' 8 ';
EXCEPTION WHEN OTHERS THEN
l_errm: = sqlerrm;
ROLLBACK;
INSERT INTO log (log_date, log_value)
values (sysdate, ' L = ' || l_line.....
|| CHR (10) || ' o_res = ' || o_res
|| CHR (10) || ' o_msg = ' || o_msg
|| CHR (10) || ' Oracle error: ' || l_errm
);
COMMIT;
o_res: =-1;
end <NAME>;
/

After a call from application the line gets to the table log:

L=begin2
...
o_res = 0
o_msg =
Oracle error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small

On the other hand, by a test call from command line it is fulfilled as it is necessary, . any records in log it is not added.
How such can be??

2

Re: Advise about exception in PL/SQL on ORA-06502 (character string buffer too small)

Ivan K wrote:

As such can be??

o_msg on the causing side it is too small.

3

Re: Advise about exception in PL/SQL on ORA-06502 (character string buffer too small)

Elic;
Yes, it it, thanks