ORA-06502 Error Only in SQLPLUS

818 views Asked by At

I have an Oracle 11 database on a development server. I'm trying to execute a stored procedure:

declare
    date_start varchar2(15);
    date_end varchar2(15);
begin
    Fecha_inicio := '01/01/2014';
    Fecha_fin := '01/01/2016';
    FCBK.PKG_PACKAGE.Generate(Fecha_inicio,Fecha_fin);
end;  

If I execute the procedure from SQL Developer or from SQL*Plus on my personal Windows machine, the procedure has no problem.

If I execute the procedure from SQL*Plus in the development server (IBM AIX Machine), the procedure ends with this error:

ORA-06502: PL/SQL: numeric or value error: character string buffer too small
2

There are 2 answers

0
Ildelian On BEST ANSWER

Problem solved. Was a internal error of the package. Thanks for all the answers.

2
Michiel T On

This might be caused by a difference between the NLS configuration of the 2 SQL clients. A quick check could be to first run

ALTER SESSION SET nls_date_format = 'dd/mm/yyyy'

or otherwise include

EXECUTE IMMEDIATE 'ALTER SESSION SET nls_date_format = ''dd/mm/yyyy''';

in your procedure.

To check your current NLS settings, query the "nls_session_parameters" table which lists the configuration of the current user session.

SELECT *
FROM   nls_session_parameters