Hi Experts,
I've a small doubt regarding the CR and LF.
Suppose, i have a comma separated value list say - 'a,b,c,d,e' and want to replace the
Commas ',' with
Newlines.
Initially I thought replacing always with CHR(13)||CHR(10) will do, but got confused when tried experimenting with the below code -
-- "Output seen in NOTEPAD++"
SQL> select
2 replace('a,b,c,d,e',',',CHR(10)) x1,
3 replace('a,b,c,d,e',',',CHR(13)) x2,
4 replace('a,b,c,d,e',',',CHR(13)||CHR(10)) x3,
5 replace('a,b,c,d,e',',',CHR(10)||CHR(13)) x4
6 from
7 dual;
X1 X2 X3 X4
--------- --------- ------------- -------------
a a b
c
d
e a a
b b
b
c c
c
d d
d
e e e
-- "But in SQL Plus Editor is seen differently"
-- "Again the output is visually different in Toad"
Database details :
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Solaris: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Can anybody please explain me the underlying concept?
Any pointers/clarification is highly appreciated.
Ranit B.