How to remove the carriage space using SQL query. I tried the replace (..) idea but its not working at all ? The duplicate idea is not working
Asked
Active
Viewed 58 times
-2
-
Please show an example of your data and what you have tried so far. – daShier Oct 17 '19 at 14:58
-
What exactly did you try? Please add this to the question – Islingre Oct 17 '19 at 14:58
-
I tried 'select replace (col, chr(13),'x') from table_nm; Its not working – Raj kumar Mishra Oct 17 '19 at 15:00
-
Possible duplicate of [Oracle REPLACE() function isn't handling carriage-returns & line-feeds](https://stackoverflow.com/questions/407027/oracle-replace-function-isnt-handling-carriage-returns-line-feeds) – Ankit Bajpai Oct 17 '19 at 15:07
-
No that idea is not working – Raj kumar Mishra Oct 17 '19 at 15:19
-
Take a look at this: https://stackoverflow.com/questions/16407135/oracle-regexp-to-replace-n-r-and-t-with-space – jmm312 Oct 17 '19 at 15:40
-
1You keep saying various solutions aren't working. I think you should post some sample of the text you are trying to amend; include a DUMP() output of the string so we can see the non-printing characters as well. – APC Oct 17 '19 at 16:48
2 Answers
0
I guess you should go with below code -
REPLACE(REPLACE( col_name, CHR(10)), CHR(13))
This will replace the spaces and carriage both and might solve your problem.

Ankit Bajpai
- 13,128
- 4
- 25
- 40
0
I generally use the test1 option:
select replace(replace('teste
return test', chr (13), ''), chr (10), ' ') test1,
translate('teste
return test', chr(10) || chr(13) || chr(09), ' ') test2
from dual;

Geysa O. Marinho
- 51
- 3