Unexpected ORA-06502

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
AdamKG
Posts: 18
Joined: Fri 13 Nov 2009 10:32

Unexpected ORA-06502

Post by AdamKG » Tue 27 Aug 2013 13:10

Hello I just moved to ODAC 9.0 from 8.1. In construction like

Code: Select all

  OraSession1.SQL.SQL.Text := 'begin select count(*) into :var1 from dual; end;'  ;
  OraSession1.sql.parambyname('var1').DataType := ftString;
  OraSession1.SQL.Execute;
  OraSession1.SQL.SQL.Text := 'begin select ''AnyText'' into :var1 from dual; end;';
  OraSession1.sql.parambyname('var1').DataType := ftString;
  OraSession1.SQL.Execute;  //<- ORA-06502 here
I got error. All worked before.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Unexpected ORA-06502

Post by AlexP » Wed 28 Aug 2013 06:44

Hello,

Thank you for the information - we have reproduced the problem and will try to fix it in the next version. For the time being, to solve the problem, you should call the Clear method before assigning a new SQL expression:

Code: Select all

  OraSession1.SQL.Params.Clear;

AdamKG
Posts: 18
Joined: Fri 13 Nov 2009 10:32

Re: Unexpected ORA-06502

Post by AdamKG » Sat 21 Sep 2013 07:31

Hello,
There is new version 9.1.3 and problem isn't fixed. Can I get a hotfix for this?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Unexpected ORA-06502

Post by AlexP » Mon 23 Sep 2013 10:01

Hello,

We have made changes for work with parameters. Now, if you are using the same parameter name in different SQL queries, you should either explicitly clear parameters: OraSession1.SQL.Params.Clear; or set the parameter type.


OraSession1.sql.parambyname('var1').DataType := ftString;
OraSession1.sql.parambyname('var1').ParamType := ptOutput;

Post Reply