Page 1 of 1

Unexpected ORA-06502

Posted: Tue 27 Aug 2013 13:10
by AdamKG
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.

Re: Unexpected ORA-06502

Posted: Wed 28 Aug 2013 06:44
by AlexP
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;

Re: Unexpected ORA-06502

Posted: Sat 21 Sep 2013 07:31
by AdamKG
Hello,
There is new version 9.1.3 and problem isn't fixed. Can I get a hotfix for this?

Re: Unexpected ORA-06502

Posted: Mon 23 Sep 2013 10:01
by AlexP
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;