oracle 中replace替换回车换行符号无效
我现在clob有这样一段字符:
<TABLE>
<TBODY>
<TR style="HEIGHT: 9pt; mso-height-source: userset" height=12>
<TD style="HEIGHT: 9pt" class=xl15430 height=12></TD>
<TD style="WIDTH: 31pt" class=xl79430 width=41> </TD>
<TD style="WIDTH: 26pt" class=xl87430 width=35> </TD>
<TD style="WIDTH: 29pt" class=xl69430 width=38> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=22> </TD>
<TD style="WIDTH: 35pt" class=xl70430 width=47> </TD>
<TD style="WIDTH: 34pt" class=xl70430 width=45> </TD>
<TD style="WIDTH: 40pt" class=xl70430 width=53> </TD>
<TD style="WIDTH: 30pt" class=xl70430 width=40> </TD>
<TD style="WIDTH: 4pt" class=xl70430 width=5> </TD>
<TD style="WIDTH: 37pt" class=xl70430 width=49> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=43> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 41pt" class=xl70430 width=54> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 39pt" class=xl70430 width=52> </TD>
<TD style="WIDTH: 20pt" class=xl70430 width=27> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=23> </TD>
<TD style="WIDTH: 44pt" class=xl71430 width=58> </TD>
<TD class=xl15430></TD></TR>
<TR style="HEIGHT: 13.5pt" height=18>
<TD style="HEIGHT: 13.5pt" class=xl15430 height=18></TD>
<TD class=xl98430 colSpan=13>本表一式三份,业主(建设单位)、监理、承包人各一份。</TD>
<TD class=xl63430> </TD>
<TD class=xl63430> </TD>
<TD class=xl63430> </TD>
<TD class=xl63430> </TD>
<TD class=xl63430> </TD>
<TD class=xl15430></TD></TR></TBODY></TABLE>
想把
<TR style="HEIGHT: 9pt; mso-height-source: userset" height=12>
<TD style="HEIGHT: 9pt" class=xl15430 height=12></TD>
<TD style="WIDTH: 31pt" class=xl79430 width=41> </TD>
<TD style="WIDTH: 26pt" class=xl87430 width=35> </TD>
<TD style="WIDTH: 29pt" class=xl69430 width=38> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=22> </TD>
<TD style="WIDTH: 35pt" class=xl70430 width=47> </TD>
<TD style="WIDTH: 34pt" class=xl70430 width=45> </TD>
<TD style="WIDTH: 40pt" class=xl70430 width=53> </TD>
<TD style="WIDTH: 30pt" class=xl70430 width=40> </TD>
<TD style="WIDTH: 4pt" class=xl70430 width=5> </TD>
<TD style="WIDTH: 37pt" class=xl70430 width=49> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=43> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 41pt" class=xl70430 width=54> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 39pt" class=xl70430 width=52> </TD>
<TD style="WIDTH: 20pt" class=xl70430 width=27> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=23> </TD>
<TD style="WIDTH: 44pt" class=xl71430 width=58> </TD>
<TD class=xl15430></TD></TR>
替换为: 空(即''), 我这样替换是可以的:
SELECT REPLACE(to_char('<TR style="HEIGHT: 9pt; mso-height-source: userset" height=12>
<TD style="HEIGHT: 9pt" class=xl15430 height=12></TD>
<TD style="WIDTH: 31pt" class=xl79430 width=41> </TD>
<TD style="WIDTH: 26pt" class=xl87430 width=35> </TD>
<TD style="WIDTH: 29pt" class=xl69430 width=38> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=22> </TD>
<TD style="WIDTH: 35pt" class=xl70430 width=47> </TD>
<TD style="WIDTH: 34pt" class=xl70430 width=45> </TD>
<TD style="WIDTH: 40pt" class=xl70430 width=53> </TD>
<TD style="WIDTH: 30pt" class=xl70430 width=40> </TD>
<TD style="WIDTH: 4pt" class=xl70430 width=5> </TD>
<TD style="WIDTH: 37pt" class=xl70430 width=49> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=43> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 41pt" class=xl70430 width=54> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 39pt" class=xl70430 width=52> </TD>
<TD style="WIDTH: 20pt" class=xl70430 width=27> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=23> </TD>
<TD style="WIDTH: 44pt" class=xl71430 width=58> </TD>
<TD class=xl15430></TD></TR>'),
'<TR style="HEIGHT: 9pt; mso-height-source: userset" height=12>
<TD style="HEIGHT: 9pt" class=xl15430 height=12></TD>
<TD style="WIDTH: 31pt" class=xl79430 width=41> </TD>
<TD style="WIDTH: 26pt" class=xl87430 width=35> </TD>
<TD style="WIDTH: 29pt" class=xl69430 width=38> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=22> </TD>
<TD style="WIDTH: 35pt" class=xl70430 width=47> </TD>
<TD style="WIDTH: 34pt" class=xl70430 width=45> </TD>
<TD style="WIDTH: 40pt" class=xl70430 width=53> </TD>
<TD style="WIDTH: 30pt" class=xl70430 width=40> </TD>
<TD style="WIDTH: 4pt" class=xl70430 width=5> </TD>
<TD style="WIDTH: 37pt" class=xl70430 width=49> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=43> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 41pt" class=xl70430 width=54> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 39pt" class=xl70430 width=52> </TD>
<TD style="WIDTH: 20pt" class=xl70430 width=27> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=23> </TD>
<TD style="WIDTH: 44pt" class=xl71430 width=58> </TD>
<TD class=xl15430></TD></TR>'
,'') from dual c
但是,我这样替换就不行,
select replace(c.doccontent,
'<TR style="HEIGHT: 9pt; mso-height-source: userset" height=12>
<TD style="HEIGHT: 9pt" class=xl15430 height=12></TD>
<TD style="WIDTH: 31pt" class=xl79430 width=41> </TD>
<TD style="WIDTH: 26pt" class=xl87430 width=35> </TD>
<TD style="WIDTH: 29pt" class=xl69430 width=38> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=22> </TD>
<TD style="WIDTH: 35pt" class=xl70430 width=47> </TD>
<TD style="WIDTH: 34pt" class=xl70430 width=45> </TD>
<TD style="WIDTH: 40pt" class=xl70430 width=53> </TD>
<TD style="WIDTH: 30pt" class=xl70430 width=40> </TD>
<TD style="WIDTH: 4pt" class=xl70430 width=5> </TD>
<TD style="WIDTH: 37pt" class=xl70430 width=49> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=43> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 41pt" class=xl70430 width=54> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 39pt" class=xl70430 width=52> </TD>
<TD style="WIDTH: 20pt" class=xl70430 width=27> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=23> </TD>
<TD style="WIDTH: 44pt" class=xl71430 width=58> </TD>
<TD class=xl15430></TD></TR>',
'TR style="HEIGHT: 9pt; mso-height-source: userset" height=12>
<TD style="HEIGHT: 9pt" class=xl15430 height=12></TD>
<TD style="WIDTH: 31pt" class=xl79430 width=41> </TD>
<TD style="WIDTH: 26pt" class=xl87430 width=35> </TD>
<TD style="WIDTH: 29pt" class=xl69430 width=38> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=22> </TD>
<TD style="WIDTH: 35pt" class=xl70430 width=47> </TD>
<TD style="WIDTH: 34pt" class=xl70430 width=45> </TD>
<TD style="WIDTH: 40pt" class=xl70430 width=53> </TD>
<TD style="WIDTH: 30pt" class=xl70430 width=40> </TD>
<TD style="WIDTH: 4pt" class=xl70430 width=5> </TD>
<TD style="WIDTH: 37pt" class=xl70430 width=49> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=43> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 41pt" class=xl70430 width=54> </TD>
<TD style="WIDTH: 32pt" class=xl70430 width=42> </TD>
<TD style="WIDTH: 39pt" class=xl70430 width=52> </TD>
<TD style="WIDTH: 20pt" class=xl70430 width=27> </TD>
<TD style="WIDTH: 17pt" class=xl70430 width=23> </TD>
<TD style="WIDTH: 44pt" class=xl71430 width=58> </TD>
<TD class=xl15430></TD></TR>'
, '') kk
from ip_doc_entity c
where c.id='8a96982340c84e5e0140dde405f363b8'
往各位大神指点
[解决办法]
不知道你查这个要干什么!如果是想传到程序页面 那样就放到程序里面去转化Clob to String
[解决办法]
oracle是什么版本?