Oracle Number类型超长小数位为0问题

  碰到了一个非常奇怪的问题,从Excel拷贝出来的数据,位数很长,通过Pl Sql 导出到Oracle后为0了,而且设置查询条件为0时,无法查询出来,条件大于0居然能查询出来,通过to_number也是无法转换的

    比如:where FTD_PS > 0,能查询出来数据为0的number类型,where FTD_PS =0 无法查询出等于0的,这就很奇怪,只能依据to_number无法转换来盘该种数据类型,最后写了一个函数进行数据更新。

create or replace function isnumber(p_in varchar2) return number as
  i number;
begin
  i := to_number(p_in);
  return 1;
exception
  when others then
    return 0;
end;


--更新
 update table set column = 0 where isnumber(column) = 0;

 

 

posted on 2013-10-12 16:32  ToKens  阅读(1112)  评论(0编辑  收藏  举报