您的位置:首页 > 博客中心 > 数据库 >

oracle 字符转换成数字

时间:2022-03-14 01:36

1>函数转换

select nvl2(translate(a.data, ‘\1234567890.‘, ‘\‘), null, a.data) n, a.data
  from rpt_detail a;

2>自定义函数

1 create   or   replace   function   isNumber(p_in   varchar2)   return   boolean   as  
2         i   number;  
3 begin  
4         i:=to_number(p_in);  
5         return   true;  
6 exception        
7         when   others   then    
8               return   false;  
9 end   ; 

 

热门排行

今日推荐

热门手游