oracle 字符轉換成數字


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   ; 

 程序員的基礎教程:菜鳥程序員


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM