ORA-06502: PL/SQL: numeric or value error

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Guest

ORA-06502: PL/SQL: numeric or value error

Post by Guest » Tue 21 Dec 2004 10:55

Hi!

There is a problem with ODAC 5 (v5.10.0.5 30.06.04) & Delphi 7.

Test sample:

create table a_clients (s_client_no char(7) not null, s_client_name varchar(45));

PACKAGE A_PACKAGE
IS
FUNCTION get_client_name
( client_no IN a_clients.s_client_no%TYPE DEFAULT NULL,
client_name OUT varchar)
RETURN integer;

END;

PACKAGE BODY A_PACKAGE
IS
FUNCTION get_client_name
( client_no IN a_clients.s_client_no%TYPE DEFAULT NULL,
client_name OUT varchar)
RETURN integer
IS
BEGIN
client_name := 'client_name';
return 0;
END;
END;

If I try to do the following in Delphi source -

...
OraStoredProc1.StoredProcName := 'a_package.get_client_name';
OraStoredProc1.Prepare;
OraStoredProc1.ParamByName('client_no').AsString := '0000001';
OraStoredProc1.Execute;
...

error ORA-06502 follows

But it works fine if do one of the following -

specify another data type for fixed char parameter:

...
OraStoredProc1.StoredProcName := 'a_package.get_client_name';
OraStoredProc1.Prepare;
OraStoredProc1.ParamByName('client_no').DataType := ftString;
OraStoredProc1.ParamByName('client_no').AsString := '0000001';
OraStoredProc1.Execute;
...

or specify not max length value for fixed char parameter:

...
OraStoredProc1.StoredProcName := 'a_package.get_client_name';
OraStoredProc1.Prepare;
OraStoredProc1.ParamByName('client_no').AsString := '000001';
OraStoredProc1.Execute;
...


Thanks in advance.

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

Post by Paul » Thu 23 Dec 2004 08:24

What is the Oracle server version?
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.

shihare
Posts: 1
Joined: Tue 21 Dec 2004 10:43

Post by shihare » Wed 05 Jan 2005 09:33

Oracle Server version:

Oracle Database 10g Release 10.1.0.3.0 - 64bit Production

Odac components:

5.10.4.13 24.11.04

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

Post by Alex » Wed 05 Jan 2005 15:18

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

Post Reply