i find a bug about String Param for Version 4.5.9

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
daizhicun
Posts: 109
Joined: Thu 21 Jan 2010 11:49

i find a bug about String Param for Version 4.5.9

Post by daizhicun » Sun 14 Oct 2012 11:29

when i User Old Version of UniDAC(perhaps a years ago):
if i Execute follow delphi code:(database is oracle 11gR2 ,delphi is XE):

Code: Select all

 begin
  UniQuery1.SQL.text:='begin :ABC:=''hello''; end;';
  UniQuery1.params[0].DataType=ftString;
  UniQuery1.params[0].value:='1';
  UniQuery1.execute;
  showmessage(UniQuery1.params[0].value); //it shows: hello
 end;
it is ok, i use uniMoniter1 get the moniter sql:

Timestamp: 19:04:16:050
BEGIN
:ABC:='hello';
END;
:ABC(WideString[1])='1'


But, now ,i use the newest Version : Version 4.5.9 for RAD Studio XE

it shows error:

Timestamp: 19:17:50:248
Error: ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小
ORA-06512: 在 line 2

but ,if i set the init value's length above the fact value ,it is ok:

Code: Select all

 begin
  UniQuery1.SQL.text:='begin :ABC:=''hello''; end;';
  UniQuery1.params[0].DataType=ftString;
// the length of  the init Value must above the fact Value,it will be ok; 
  UniQuery1.params[0].value:='123456';  // length('123456')>lenght('hello');
  UniQuery1.execute;
  showmessage(UniQuery1.params[0].value); //it shows: hello
 end;
so , i think Version 4.5.9 is the first version for XE3;
it perhaps has errors for string Params;



but if i use ftBlob param,it is ok:

Code: Select all

 begin
  UniQuery1.SQL.text:='begin :ABC:=''hello''; end;';
  UniQuery1.params[0].DataType=ftBlob ;
  UniQuery1.params[0].value:='1';
  UniQuery1.execute;
 end;
Last edited by daizhicun on Sun 14 Oct 2012 12:12, edited 4 times in total.

daizhicun
Posts: 109
Joined: Thu 21 Jan 2010 11:49

Re: i find a bug about String Param

Post by daizhicun » Sun 14 Oct 2012 11:32

if you find how to fixed this bug ,can you tell us where to fiexd .pas code.

and i hope this bug can been fixed at next version soon.

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

Re: i find a bug about String Param for Version 4.5.9

Post by AlexP » Mon 15 Oct 2012 11:03

hello,

Thank you for the information, we have reproduced the problem.
As soon as we fix it, we will send you the changes necessary to solve the problem.

daizhicun
Posts: 109
Joined: Thu 21 Jan 2010 11:49

Re: i find a bug about String Param for Version 4.5.9

Post by daizhicun » Mon 15 Oct 2012 11:19

thanks very much.
if you fix it . please send the fixed pas code to my email: [email protected]

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

Re: i find a bug about String Param for Version 4.5.9

Post by AlexP » Thu 18 Oct 2012 13:15

hello,

The behavior change in the latest versions is connected with fixing the errors that occured when working with the OUT parameters.
In the latest versions when working with the OUT paremeters, in addition to DataType, ParamType should also be specified explicitly for the OUT parameters.
To solve the problem, you should add the following line to your code:
OraQuery.Params[0].ParamType := ptInputOutput;

Post Reply