Oracle函数+for循环

create or replace function FilterMinganci(str in varchar) return varchar2 is

  filterWorld varchar2(1000);

  keyCount    int;

begin

  filterWorld := str;

  keyCount    := 0;

  select count(1) into keyCount from dic_keyword;

  for aa in (select keyword from dic_keyword) loop

   select  replace(filterWorld, aa.keyword, '*') into filterWorld from dual;

    keyCount := keyCount - 1;

    exit when keyCount = 0;

  end loop;

  return(filterWorld);

end;

  

你可能感兴趣的:(Oracle函数)