oracle替换clob里面的某个特定的字符串
oracle替换clob里面的某个特定的字符串
关键字:replace,dbms_lob.instr
第一步:判断clob里面是有包含某个特定的字符串:假如是说“/admin/ewebeditor/uploadfile/“
关键字:dbms_lob.instr
Code:
[sql] select st.id,st.content from t_d_strategy st where dbms_lob.instr(st.content,'/admin/ewebeditor/uploadfile/') > 0;
第二步:用replace先替换下看是否是自己想要的结果
关键字:replace
Code:
[sql] select st.id,replace(st.content,'/admin/ewebeditor/uploadfile/','E:/resource/images/uploadfile/') from t_d_strategy st where st.id = 553 and dbms_lob.instr(st.content,'/admin/ewebeditor/uploadfile/') > 0;
第三步:替换,前面的两步ok,肯定错不了的
关键字:update set
Code:
[sql] update t_d_strategy st set st.content = replace(st.content,'/admin/ewebeditor/uploadfile/','E:/resource/images/uploadfile/') where st.id = 553 and dbms_lob.instr(st.content,'/admin/ewebeditor/uploadfile/') > 0;
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。