亚洲免费在线视频-亚洲啊v-久久免费精品视频-国产精品va-看片地址-成人在线视频网

您的位置:首頁技術文章
文章詳情頁

Oracle存儲過程中去掉重復字符串函數

瀏覽:139日期:2023-11-21 09:28:38
以下函數是本人在編寫Oracle數據庫存儲過程時寫的函數,覺得該函數通用性較強,因此發表出來供需要的人參考。 這個函數的功能主要是用于去除給定字符串中重復的字符串.在使用中需要指定字符串的分隔符.示例: str := MyReplace('13,14,13,444', ','); 輸出: 13,14,444create or replace function MyReplace(oldStr varchar2, sign varchar2) return varchar2 is str varchar2(1000); currentIndex number; startIndex number; endIndex number; type str_type is table of varchar2(30) index by binary_integer; arr str_type; Result varchar2(1000);begin if oldStr is null then return (''); end if; str := oldStr; currentIndex := 0; startIndex := 0; loop currentIndex := currentIndex + 1; endIndex := instr(str, sign, 1, currentIndex); if (endIndex <= 0) then exit; end if; arr(currentIndex) := trim(substr(str, startIndex + 1, endIndex - startIndex - 1)); startIndex := endIndex; end loop;取最后一個字符串: arr(currentIndex) := substr(str, startIndex + 1, length(str));去掉重復出現的字符串: for i in 1.. currentIndex - 1 loop for j in i + 1..currentIndex loop if arr(i) = arr(j) then arr(j) := ''; end if; end loop; end loop; str := ''; for i in 1..currentIndex loop if arr(i) is not null then str := str sign arr(i);數組置空: arr(i) := ''; end if; end loop;去掉前面的標識符: Result := substr(str, 2, length(str)); return(Result);end MyReplace;
標簽: Oracle 數據庫
主站蜘蛛池模板: 极品美女一级毛片 | 欧美一级片免费看 | 日本成人午夜 | 国产午夜免费不卡精品理论片 | wwww亚洲| 亚洲欧美综合一区二区三区四区 | 日韩美女视频一区 | 一级做a爱过程免费视频时看 | 久久精品在线视频 | 欧美视频一区二区专区 | 看三级毛片 | 亚洲国产另类久久久精品小说 | 中国老太性色xxxxxhd | 宅男69免费永久网站 | 中文字幕福利片 | 亚洲 [12p]| 日本一级特黄特色大片免费视频 | 欧美日韩日本国产 | 99视频福利 | 久草com | 亚洲一区www| 做爰www免费看视频 1024色淫免费视频 | 欧美国产一区二区三区 | 成人片网址 | 日本久久香蕉一本一道 | 国产一区二区三区四区五区tv | 日本不卡不码高清免费观看 | www.日本在线观看 | 欧美手机看片 | 国产成人精品日本亚洲专区6 | 国产成人综合亚洲亚洲欧美 | 中文字幕亚洲精品日韩精品 | 国产精品亚洲片在线观看不卡 | 国产精品国产三级国产an不卡 | 在线播放亚洲美女视频网站 | 亚洲欧美在线综合一区二区三区 | 亚洲经典三级 | 国产3级在线观看 | 日韩欧美一区二区三区不卡在线 | 成年人视频在线免费 | 成人免费视频播放 |