oracle 自定义函数:
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
CREATE OR REPLACE FUNCTION ConvertNumeric(rawData VARCHAR2) --用于返回转换科学计算法dhx RETURN VARCHAR2 IS finalData VARCHAR2(200); EIndex INT; BEGIN EIndex := 0; EIndex := instr(upper(rawData),'E'); if EIndex>0 then if (substr(rawData,EIndex+1,1)='+' and length(substr(rawData,0,EIndex-1))>0 and length(substr(rawData,EIndex+2))>0) then finalData:=to_char(to_number(substr(rawData,0,EIndex-1))*power(10,to_number(substr(rawData,EIndex+2)))); elsif (substr(rawData,EIndex+1,1)='-' and length(substr(rawData,0,EIndex-1))>0 and length(substr(rawData,EIndex+2))>0 )then finalData:=to_char(to_number(substr(rawData,0,EIndex-1))/power(10,to_number(substr(rawData,EIndex+2))),'fm99999999999999999999990.9999999999999999'); else finalData:=rawData; end if; else finalData:=rawData; end if; RETURN finalData; EXCEPTION WHEN OTHERS THEN finalData:=rawData; RETURN finalData; END ConvertNumeric;