Just replace +'CRLF'
with +CHAR(13)+CHAR(10)
(there are some +' CRLF '
which I suppose should be treated like +'CRLF'
)
Anyway, CR LF (carriage return followed by linefeed, char(13)+char(10)
) is the DOS-like line terminator, the Unix-like one is LF (char(10)
)
Could it be that the output of your query should be JSON-compatible? In this case, you should replace +'CRLF'
(and +' CRLF ')
with +'\n
' or +'\\n'
(or even +'\\\\n'
, depending on the number of levels that use \
as the escape character).
If, instead, as it seems from your comments, you are in a Unixish environment (lua in Iguana) that gets control characters escaped from SQL, you will have to live with that, by replacing +'CRLF'
with +CHAR(10)
and letting the interpretation of the resulting \n
s happen at a later stage.