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;
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;
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;