Syntactically incorrect (one 'replace' too much). IMHO translate() is the one to use 
here. Probably a negligible performance benefit but I find a single function call 
easier to read than a function taking another function call as argument. The fewer 
characters the better (I type slowly and badly). My personal taste ...

SQL> get x
  1  select replace(replace('hello' || chr(13) || chr(10) || 'world',
  2                 chr(13),'R'),chr(10),' ')
  3* from dual
SQL> /

REPLACE(REPL
------------
helloR world

SQL> get x2
  1  select translate('hello' || chr(13) || chr(10) || 'world',
  2              chr(13)||chr(10),'R ')
  3* from dual
SQL> /

TRANSLATE('H
------------
helloR world

SF

>----- ------- Original Message ------- -----
>From: "Hallas, John, Tech Dev"
><[EMAIL PROTECTED]>
>To: Multiple recipients of list ORACLE-L
><[EMAIL PROTECTED]>
>Sent: Wed, 17 Sep 2003 07:59:43
>
>IA,
>
>The following code should be close to what you want
>
>
>select
>replace(replace(replace(a,chr(13),'R'),chr(10),''))
> from table
>
>John
>
>-----Original Message-----
>Sent: 16 September 2003 16:15
>To: Multiple recipients of list ORACLE-L
>
>
>Hi,
>
>I have a column with carriage returns (chr(13) )
>and line feeds (chr(10)). I
>want to select this column replacing the chr(13)
>with 'R' and chr(10) with '
>' .
>
>Whats the best way to do this?
>
>Regards
>
>IA
>-- 
>Please see the official ORACLE-L FAQ:
>http://www.orafaq.net
>-- 
>Author: Imran Ashraf
>  INET: [EMAIL PROTECTED]
>
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephane Faroult
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to