Page 1 of 1

ora-06502

Posted: Tue 14 Dec 2004 15:23
by Starina
After installation of the Oracle server patch 9.2.0.6
the ORA-06502 error is often raised during
our stored procedures and PL/SQL blocks running.
How can it be prevented? :?:

Posted: Wed 15 Dec 2004 07:30
by Paul
Send us please small demo project to demonstrate the problem
and include script to create server objects to ODAC support address.

Posted: Wed 15 Dec 2004 11:55
by Starina
All functions with varchar2 parameter.
Second call of the function with parameter which has length larger then first call parameter raise exception.

Posted: Wed 15 Dec 2004 14:22
by Guest
did you tested in a new project?
i have get that exception by using the TOraAlerter component, which also calls stored proc. and it seems to conflict with one of my other Statements... but i can't recognize which one...

Posted: Fri 17 Dec 2004 15:09
by Paul
You can get this error message if you have OUT parameters in stored procedure and TOraParam.PatamType = ptUnknown. You must explicitly set PatamType to ptOutput or prInputOutput. Please specify a script for creating server procedure.

Ora-06502

Posted: Mon 20 Dec 2004 12:09
by Starina
The ORA-06502 error is raised ONLY :!: after the Oracle server
patch 9.2.0.6 installation.

Repeated call of any :!: functions containing at least one
VARCHAR2 type parameter (if the parameter value is greater then one in
the first call :!:) raises this error.

Example:

in Oracle (SCOTT/TIGER schema):

sql:
create or replace function get_deptno(in_dname varchar2, in_loc varchar2) return number as
v_return number;
begin
select
sd.deptno into v_return
from dept sd
where sd.dname = in_dname
and sd.loc = in_loc;

return(v_return);
end;

in Delphi:

dfm:
object OraStoredProc1: TOraStoredProc
StoredProcName = 'SCOTT.GET_DEPTNO'
Session = OraSession1
SQL.Strings = (
'begin'
' :RESULT := SCOTT.GET_DEPTNO(:IN_DNAME, :IN_LOC);'
'end;')
Debug = True
Left = 132
Top = 8
ParamData =
pas:
function TForm1.GetDeptNo(AName, ALoc: string): Integer;
begin
with OraStoredProc1 do
begin
ParamByName('IN_DNAME').AsString := AName;
ParamByName('IN_LOC').AsString := ALoc;
ExecProc;
Result := ParamByName('RESULT').AsInteger;
end;
end;

The first call completes error-free:
debug:
begin
:RESULT := SCOTT.GET_DEPTNO(:IN_DNAME, :IN_LOC);
end;

:RESULT(FLOAT,OUT)=
:IN_DNAME(VARCHAR[5],IN)='SALES'
:IN_LOC(VARCHAR[7],IN)='CHICAGO'

The second call raises the error (LENGTH(IN_DNAME = 'RESEARCH') > LENGTH(IN_DNAME = 'SALES')):
debug:
begin
:RESULT := SCOTT.GET_DEPTNO(:IN_DNAME, :IN_LOC);
end;

:RESULT(FLOAT,OUT)=30
:IN_DNAME(VARCHAR[8],IN)='RESEARCH'
:IN_LOC(VARCHAR[6],IN)='DALLAS'

Posted: Thu 23 Dec 2004 08:13
by Paul
We got your request and now examines the problem.
Unfortunately now we couldn't give you any information.
As soon as we solve the problem, we'll let you know.

ora-06502

Posted: Fri 21 Jan 2005 09:33
by Starina
When will this problem be solved?

Posted: Fri 21 Jan 2005 10:30
by cis-wurzen
It seams to be an Oracle problem.
Have a look at this patch

Patch 4015165
Description REGRN:SCALAR VARCHAR2 IN BINDS WITH DIFFERENT SIZE RANDOMLY
FAILS WITH ORA-06502
Product PLSQL
Release Oracle 9.2.0.6

Posted: Fri 21 Jan 2005 15:52
by Alex
We fixed this issue with Oracle 9.2.0.6. This fix will be included in the next ODAC build. It will be available in about several days.

Posted: Thu 17 Mar 2005 20:24
by Guest
When it will be available for Odac 4.5x