create or replace function fn_substrnum(colname in varchar2,
old_str in varchar2)
return varchar2 is
subnum number(10);
/**
查找表中指定字段字符串的子字符串个数
*/
begin
return nvl(length(colname),0)-nvl(length(replace(colname,old_str,'')),0);
end fn_substrnum;
create or replace function fn_substrnum(colname in varchar2,
old_str in varchar2)
return varchar2 is
subnum number(10);
/**
查找表中指定字段字符串的子字符串个数
*/
begin
return nvl(length(colname),0)-nvl(length(replace(colname,old_str,'')),0);
end fn_substrnum;