Trim Whitespaces (New Line and Tab space) in a String in Oracle

前端 未结 14 1049
挽巷
挽巷 2021-01-30 10:29

I need to trim New Line (Chr(13) and Chr(10) and Tab space from the beginning and end of a String) in an Oracle query. I learnt that there is no easy way to trim multiple charac

14条回答
  •  萌比男神i
    2021-01-30 11:13

    If at all anyone is looking to convert data in 1 variable that lies in 2 or 3 different lines like below

    'Data1
    
    Data2'
    

    And you want to display data as 'Data1 Data2' then use below

    select TRANSLATE ('Data1
    
    Data2', ''||CHR(10), ' ') from dual;
    

    it took me hrs to get the right output. Thanks to me I just saved you 1 or 2 hrs :)

提交回复
热议问题