Oracle函数总结
Clob字段替换 replace(x,y,z)返回为将串X中的Y串用Z串替换后的结果字符串。若省略Z参数,则将串X中为Y串的地方删除 update ypgcxx.T_ARTICLE_INFO st set st.F_CONTENT = replace(st.F_CONTENT,'/portal/','/ypgcxx/') where dbms_lob.instr(st.F_CONTENT,'/
Clob字段值替换
replace(x,y,z)返回值为将串X中的Y串用Z串替换后的结果字符串。若省略Z参数,则将串X中为Y串的地方删除
update ypgcxx.T_ARTICLE_INFO st set st.F_CONTENT = replace(st.F_CONTENT,'/portal/','/ypgcxx/') where dbms_lob.instr(st.F_CONTENT,'/portal/') > 0;
commit;
--按条件检索Clob字段内容
select st.F_CONTENT from qzxyfszx.T_ARTICLE_INFO st where dbms_lob.instr(st.F_CONTENT,'/qyfz/')>0
update qzxyfszx.T_ARTICLE_INFO st set st.F_CONTENT = replace(st.F_CONTENT,'/qhcwwmzx/','/qyfz/') where dbms_lob.instr(st.F_CONTENT,'/qhcwwmzx/')>0
select st.F_CONTENT from tchqxx.T_ARTICLE_INFO st where dbms_lob.instr(st.F_CONTENT,'/tchqxx/')>0
update tchqxx.T_ARTICLE_INFO st set st.F_CONTENT = replace(st.F_CONTENT,'/tchqxx/','/tcxhqxx/') where dbms_lob.instr(st.F_CONTENT,'/tchqxx/')>0;
commit;
select st.F_CONTENT from tchqxx.T_ARTICLE_INFO st where dbms_lob.instr(st.F_CONTENT,'/tcxhqxx/')>0