Page 1 of 1

Wrong line break processing

Posted: Sat 04 Jul 2020 08:01
by sinys
Hello,
Delphi 10.3 + ODAC 11.2.5

Code: Select all

select dump('
1
2
3
') from dual
When I execute this query in Pl/Sql Developer I have got expected result
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;
DUMP('123')
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;
/
This code succesfully executs in Pl/Sql Developer and raises "ORA-06502 pl/sql buffer too small" for OraScript.

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;
Please fix it.

Re: Wrong line break processing

Posted: Mon 06 Jul 2020 19:48
by sinys
Advanced demo with problem
demo

Re: Wrong line break processing

Posted: Wed 15 Jul 2020 12:54
by MaximG
Thank you for the information. We will investigate the described issue and let you know the results shortly.