写一个函数,可以简单的写成这样: create function f_demo(varchar2 strNum) return number is n number; begin n:=to_number(strNum); return 1; exception when others return 0; end; / select * from tb where f_demo(colNum)=1;
捕捉异常啦 a number; begin a := to_number(记录) ; 数字时的操作 excepton when others then 不是数字的操作 end
create function f_demo(varchar2 strNum)
return number is
n number;
begin
n:=to_number(strNum);
return 1;
exception when others
return 0;
end;
/
select * from tb where f_demo(colNum)=1;
a number;
begin
a := to_number(记录) ;
数字时的操作
excepton
when others then
不是数字的操作
end