久久福利_99r_国产日韩在线视频_直接看av的网站_中文欧美日韩_久久一

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

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

瀏覽:140日期: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 數據庫
主站蜘蛛池模板: 亚洲精品一 | 曰批视频在线观看 | 久操草| 国产午夜精品久久 | www.国产一区 | 亚洲精品免费看 | 男女黄色免费网站 | 日本阿v视频高清在线中文 中文二区 | 国产欧美综合一区二区三区 | 成人免费小视频 | 综合伊人 | 国产真实精品久久二三区 | a免费在线| 欧美xxxx片 | 精品一区久久 | 天堂在线中文字幕 | 国产精品欧美一区二区三区不卡 | 中文字幕一区在线 | av在线免费观看一区二区 | 一区二区高清 | 一区二区在线 | 99久久精品一区二区成人 | 欧美精品在线一区二区三区 | 黄色网在线看 | 久久亚洲国产精品 | 一区二区免费在线观看 | 亚洲欧美日韩电影 | 日韩无在线 | 亚洲精品麻豆 | 91.成人天堂一区 | 亚洲精品专区 | zzzwww在线观看免 | 精品成人免费一区二区在线播放 | 亚洲欧洲成人 | 伊人婷婷 | 毛片入口 | 国产亚洲精品久久久456 | 欧美一区二区三区四区不卡 | 一区二区精品视频 | 九九综合 | 日韩资源在线 |