碰到了一个非常奇怪的问题,从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;

 

 

相关文章:

  • 2021-12-20
  • 2021-11-27
  • 2021-09-24
  • 2021-10-31
  • 2022-12-23
  • 2021-12-10
  • 2022-01-12
猜你喜欢
  • 2022-01-15
  • 2022-12-23
  • 2021-10-23
  • 2022-12-23
  • 2021-09-20
  • 2022-01-18
  • 2021-12-10
相关资源
相似解决方案