oarcle 提取数字函数

View Code
create or replace function get_number(str varchar2)
return varchar2 is
v_rs varchar2(4000);
begin
if str is null then
return null;
else
for i IN 1 .. length(str) loop
if ascii(substr(str, i, 1)) between 48 and 57 then
v_rs := v_rs || substr(str, i, 1);
end if;
end loop;
return v_rs;
end if;
end;
select get_number('aa2') from dual;
原文地址:https://www.cnblogs.com/Mr0909/p/2276538.html