如何在oracle中分割单词

时间:2018-12-18 13:07:33

标签: oracle plsql word-wrap

问题:显示的文本没有换行符或chr(10);

假设测试

列名(文本)

       hello world hello world hello world hello world.
       hello world.
我尝试过的

sql

select REPLACE(REPLACE( text, CHR(10) ), CHR(13) )  
from dual

但是它仍然在单行中提供输出。

hello world hello world hello world hello world.hello world.

最欢迎任何解决方案。

有效的解决方案

select REPLACE(REPLACE(textn,chr(10) , '<br>'),chr(13),'') 
  INTO v_text 
from dual;

2 个答案:

答案 0 :(得分:1)

以这种方式尝试

select REPLACE(text, string_to_be_replaced, chr(10)||chr(13)) from dual;

SQL Developer的结果:

enter image description here

答案 1 :(得分:0)

有效的解决方案

Sql

 select REPLACE(REPLACE(textn,chr(10) , '<br>'),chr(13),'') 
     INTO v_text 
  from dual;