最近发现在9i上 用replace函数 将clob中某一个字符串替换成空(就是'')时的问题。应该算个bug吧。
在10g上已经解决。
连接到:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.8.0 - Production
bill_work@HBBILL> set serveroutput on
bill_work@HBBILL> DECLARE
2 vs_clob clob := '>abcd<';
3 vs_clob2 clob;
4 vs_clob1 clob;
5 vs_str varchar2(50):= '>abcd<';
6
7 BEGIN
8
9
10 vs_clob1 := REPLACE(vs_clob,'>abcd<','><');
11 vs_clob2 := REPLACE(vs_clob,'abcd','');
12 vs_str := REPLACE(vs_str,'abcd','');
13
14 dbms_output.put_line(vs_clob1);
15 dbms_output.put_line(vs_clob2);
16 dbms_output.put_line(vs_str);
17 END;
18 /
><
>abcd<
><
PL/SQL 过程已成功完成。
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
pooo_owner_user@POOO> set serveroutput on
pooo_owner_user@POOO>
pooo_owner_user@POOO> DECLARE
2 vs_clob clob := '>abcd<';
3 vs_clob2 clob;
4 vs_clob1 clob;
5 vs_str varchar2(50):= '>abcd<';
6
7 BEGIN
8
9
10 vs_clob1 := REPLACE(vs_clob,'>abcd<','><');
11 vs_clob2 := REPLACE(vs_clob,'abcd','');
12 vs_str := REPLACE(vs_str,'abcd','');
13
14 dbms_output.put_line(vs_clob1);
15 dbms_output.put_line(vs_clob2);
16 dbms_output.put_line(vs_str);
17 END;
18 /
><
><
><
PL/SQL 过程已成功完成。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16923247/viewspace-719187/
,如需转载,请注明出处,否则将追究法律责任。