Wrong line break processing

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Wrong line break processing

Post by sinys » Sat 04 Jul 2020 08:01

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.

sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Re: Wrong line break processing

Post by sinys » Mon 06 Jul 2020 19:48

Advanced demo with problem
demo

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Wrong line break processing

Post by MaximG » Wed 15 Jul 2020 12:54

Thank you for the information. We will investigate the described issue and let you know the results shortly.

Post Reply