国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

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

Oracle存儲過程中去掉重復字符串函數(shù)

瀏覽:109日期:2023-11-21 09:28:38
以下函數(shù)是本人在編寫Oracle數(shù)據庫存儲過程時寫的函數(shù),覺得該函數(shù)通用性較強,因此發(fā)表出來供需要的人參考。 這個函數(shù)的功能主要是用于去除給定字符串中重復的字符串.在使用中需要指定字符串的分隔符.示例: 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));去掉重復出現(xiàn)的字符串: 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);數(shù)組置空: arr(i) := ''; end if; end loop;去掉前面的標識符: Result := substr(str, 2, length(str)); return(Result);end MyReplace;
主站蜘蛛池模板: 在线国产毛片 | 久久久久久久国产精品影院 | 成人永久免费视频 | 九九视频精品在线 | 久草视频在 | 在线观看国产 | 日本aaaa片毛片免费 | 91网站国产 | 国产在线观看午夜不卡 | 91年精品国产福利线观看久久 | 亚洲免费高清视频 | 国产高中生粉嫩无套第一次 | 黄色三级网站免费 | 美日韩一区二区三区 | 一级毛毛片毛片毛片毛片在线看 | 欧美大片aaaa一级毛片 | 国产精品二区在线 | cao在线| 国产成人综合在线视频 | 老司机免费福利午夜入口ae58 | 成人免费网站久久久 | 在线视频一区二区三区在线播放 | 亚洲人成综合网站在线 | 久9精品视频 | 黄篇网址 | 久久国内精品自在自线观看 | 中文字幕亚洲不卡在线亚瑟 | 欧美性色黄大片在线观看 | 黄色网址亚洲 | 亚洲美女视频网址 | 一级a级国产不卡毛片 | 波多野结衣一区二区三区高清在线 | 久久国产热视频 | 在线观看成年视频 | 亚洲综合色一区二区三区另类 | 国产成人精品天堂 | 久久精品成人一区二区三区 | 日韩欧美高清在线 | 久久爱99re| 91精品观看91久久久久久 | 久久精品国产99久久 |