How do I remove CHAR(10) and Char(13) from a table column

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rsmania
    New Member
    • Sep 2010
    • 1

    How do I remove CHAR(10) and Char(13) from a table column

    I import information from a third party and they have the ability in the description field to do carriage returns and line feeds. How can I remove the carriage returns and line feeds from the select before updating our table
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Can you please post the query that you are trying?
    You can very well remove the carriage returns and line feed by a simple replace statement.

    Something like:

    [code=oracle]
    SQL> ed
    Wrote file afiedt.buf

    1 with t as (SELECT 'This is line 1'||CHR(10)||'T his is line2' col1 from dual)
    2* SELECT col1 from t
    SQL> /

    COL1
    ----------------------------
    This is line 1
    This is line2


    SQL> ed
    Wrote file afiedt.buf

    1 with t as (SELECT 'This is line 1'||CHR(10)||'T his is line2' col1 from dual)
    2* SELECT col1,REPLACE(co l1,CHR(10),' ') clean_data from t
    SQL> /

    COL1 CLEAN_DATA
    ---------------------------- ----------------------------
    This is line 1 This is line 1 This is line2
    This is line2


    SQL>

    [/code]

    Comment

    Working...