Oracle函式總結

2021-06-27 17:32:43 字數 926 閱讀 9184

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

Oracle函式總結

instr 源字串,目標字串,起始位置,匹配序號 在oracle plsql中,instr函式返回要擷取的字串在源字串中的位置。只檢索一次,就是說從字元的開始 到字元的結尾就結束。語法如下 引數分析 string1 源字串,要在此字串中查詢。string2 要在string1中查詢的字串.start...

oracle函式總結

select initcap www.baidu.com from dual initcap a 單詞首字母大寫函式 select concat hello 你好 from dual select hello 你好 世界 from dual select substr hello你好 5,3 fro...

oracle 函式總結

a.既可以是數字也可以是日期 b.注意一定是從小到大 否則無資料 a.注意轉義字元的書寫 如 select from tpl goods where t.goodsname like 頭孢 escape a.注意null,永遠是最大 nulls last 如 select goodsid,goods...