oracle获取子串

--获取子串
create or replace function agfhd_f_substr(p_src in varchar2, p_csmc in varchar2) return varchar2
as
v_csmc varchar2(8000);
v_res varchar2(8000);
begin

v_csmc:='{'||p_csmc||'}';

select substr(p_src, INSTR(p_src,v_csmc)+length(v_csmc),INSTR(p_src,v_csmc,INSTR(p_src,v_csmc)+1)-INSTR(p_src,v_csmc)-length(v_csmc)) into v_res
from dual;


return v_res;
end agfhd_f_substr;

posted @ 2014-11-20 17:00  旦旦哥  阅读(499)  评论(0编辑  收藏  举报