oracle 将科学计数法数据转换为非科学计数法数据

oracle 自定义函数:

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;
用于返回转换科学计算法

 

你可能感兴趣的:(oracle)