Line breaks change to carriage returns when sql is updated

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ghtx001
Posts: 2
Joined: Thu 13 Aug 2020 10:22

Line breaks change to carriage returns when sql is updated

Post by ghtx001 » Mon 30 Nov 2020 11:13

Code execution in delphi
OraQuery1.SQL.Text := 'update t_users set break = ''a'#10'b''';
OraQuery1.ExecSQL;

To query data in Oracle, the characters between a and b are carriage return + line feed, and there are more carriage returns, not just line feeds
sql statement
select ascii(substr(break, 2, 1)), ascii(substr(break, 3, 1)) from t_users
search result
13, 10

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

Re: Line breaks change to carriage returns when sql is updated

Post by MaximG » Sat 13 Feb 2021 19:20

To implement the needed behavior, set the global variable RemoveCRInStringLiterals to True:

Code: Select all

uses OraClasses;
...
RemoveCRInStringLiterals := True;
...

Post Reply