ftMemo: bug if on/out param does not receive value
Posted: Mon 14 Jul 2008 13:42
ODAC 6.10
Writes:
As I guess, parameter 'b', should keep it's original value. It works while using ordinal data types, but fails with long strings. I guess if happens because ODAC uses lobs for ftMemo rather than usual TParam.Value. Does anybody know a workaround?
Code: Select all
var
S: TOraSession;
Q: TOraQuery;
procedure WriteParam (Name: string);
var L: integer; S: string;
begin
with Q.Params.ParamByName (Name) do
begin
S := AsString;
L := System.Length (S);
if L < 20
then WriteLn (Name, ' = [', S, ']')
else WriteLn ('Length (', Name, ') = ', L);
end;
end;
begin
S := TOraSession.Create (nil);
S.ConnectString := 'test/[email protected]';
Q := TOraQuery.Create (S);
Q.SQL.Text := 'begin :a := :b; if 1 < 0 then :b := ''abcde''; end if; end;';
Q.ParamByName ('a').ParamType := ptInputOutput;
Q.ParamByName ('a').DataType := ftMemo;
Q.ParamByName ('a').AsString := '';
Q.ParamByName ('b').ParamType := ptInputOutput;
Q.ParamByName ('b').DataType := ftMemo;
Q.ParamByName ('b').AsString := 'fuckedshit';
WriteParam ('a');
WriteParam ('b');
WriteLn ('-----');
Q.ExecSQL;
WriteParam ('a');
WriteParam ('b');
ReadLn;
end.Code: Select all
a = []
b = [fuckedshit]
-----
a = [fuckedshit]
Length (b) = 65514