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

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kithran
Posts: 13
Joined: Wed 05 Oct 2005 08:20

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

Post by kithran » Wed 13 Mar 2019 10:25

I'm getting ORA-06502: PL/SQL: numeric or value error: character string buffer too small when using ODAC 9.7.28 however the same code runs without issue on 5.80.0.42.

SQL Monitor shows the following:

Code: Select all

19      11:43:32  SQL Execute: begin  :result := sys.dbms_transaction.local_transaction_id; end;
20      11:43:32  :result(VARCHAR[0])=<NULL>
21      11:43:32  Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 1
The Delphi function is as follows:

Code: Select all

function GetTransactionID(ASession: TOraSession) : string;
begin
  Result := '';
  with ASession do
    if Connected then
    begin
      ExecSQL('begin' +
              '  :Result := sys.dbms_transaction.local_transaction_id; ' +
              'end;', []);
      Result :=  ParamByName('Result').AsString;
    end;
end;

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

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

Post by MaximG » Mon 18 Mar 2019 13:05

We have checked the work of ODAC 10.3.9 according to your description and found no issues. Please check the work of your project when using ODAC 10.3.9. If the error is reproduced in this case as well, please compose and send a simple test example during execution of which the issue occurs to us. For this, please use the e-support form https://www.devart.com/company/contactform.html

Post Reply