oracle 只取字符串中的数字

oracle 只取字符串中的数字
function getnumber(str varchar2) return varchar2 is --by yanleigis Email:[email protected]
rstr varchar2(4000);
begin
if str is null then
return null;
else
rstr := '';
for i IN 1 .. length(str) loop
if (ascii(substr(str, i, 1)) between 48 and 57) or
(substr(str, i, 1) = '.') then
rstr := rstr || substr(str, i, 1);
end if;
end loop;
return rstr;
end if;
end;

你可能感兴趣的:(oracle)