Delphi 10.3 + ODAC 11.2.5
Code: Select all
select dump('
1
2
3
') from dual
Typ=96 Len=7: 10,49,10,50,10,51,10
but OraQuery returns the wrong result
simple example
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
OraSession1.Connect;
OraQuery1.SQL.Text :=
'select dump(''' + #10 +
'1' + #10 +
'2' + #10 +
'3' + #10 +
''') from dual';
OraQuery1.Open;
ShowMessage(OraQuery1.Fields[0].AsString);
OraQuery1.Close;
end;
Typ=96 Len=11: 13,10,49,13,10,50,13,10,51,13,10
The same bug for OraScript for pl/sql code with strings with line breaks inside.
Code: Select all
declare
x varchar2(10) := '
1
2
3
';
begin
null;
end;
/
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
OraSession1.Connect;
OraScript1.SQL.Text :=
'declare' + #10 +
' x varchar2(10) := ''' + #10 +
'1' + #10 +
'2' + #10 +
'3' + #10 +
''';' + #10 +
'begin' + #10 +
' null;' + #10 +
'end;' + #10 +
'/' + #10;
ShowMessage(OraScript1.Statements[0].SQL);
OraScript1.Statements[0].Execute;
end;