ora-06502

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Starina
Posts: 16
Joined: Tue 14 Dec 2004 15:17

ora-06502

Post by Starina » Tue 14 Dec 2004 15:23

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? :?:

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Wed 15 Dec 2004 07:30

Send us please small demo project to demonstrate the problem
and include script to create server objects to ODAC support address.

Starina
Posts: 16
Joined: Tue 14 Dec 2004 15:17

Post by Starina » Wed 15 Dec 2004 11:55

All functions with varchar2 parameter.
Second call of the function with parameter which has length larger then first call parameter raise exception.

Guest

Post by Guest » Wed 15 Dec 2004 14:22

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...

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Fri 17 Dec 2004 15:09

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.

Starina
Posts: 16
Joined: Tue 14 Dec 2004 15:17

Ora-06502

Post by Starina » Mon 20 Dec 2004 12:09

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'

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Thu 23 Dec 2004 08:13

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.

Starina
Posts: 16
Joined: Tue 14 Dec 2004 15:17

ora-06502

Post by Starina » Fri 21 Jan 2005 09:33

When will this problem be solved?

cis-wurzen
Posts: 75
Joined: Tue 04 Jan 2005 10:26

Post by cis-wurzen » Fri 21 Jan 2005 10:30

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

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Fri 21 Jan 2005 15:52

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.

Guest

Post by Guest » Thu 17 Mar 2005 20:24

When it will be available for Odac 4.5x

Post Reply