oracle多次替换字符,批量替换,循环替换------------gxl
在这里插入代码片
create or replace function fn_buildval(p_source in Varchar2,
p_tihq in varchar2,
p_thz in varchar2)
return varchar2 as
v_val Varchar2(500);
v_nums Integer;
begin
select instr(p_source, p_tihq) into v_nums from dual;
if v_nums > 0 then
v_val := replace(p_source,p_tihq,p_thz);
if instr(v_val, p_tihq) > 0 then
v_val := fn_buildval(v_val,p_tihq,p_thz);
end if;
end if;
return v_val;
end;