Page 1 of 1

Line breaks change to carriage returns when sql is updated

Posted: Mon 30 Nov 2020 11:13
by ghtx001
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

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

Posted: Sat 13 Feb 2021 19:20
by MaximG
To implement the needed behavior, set the global variable RemoveCRInStringLiterals to True:

Code: Select all

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