Oracle date corruption during update

前端 未结 2 1612
生来不讨喜
生来不讨喜 2021-01-12 23:03

I\'m migrating some data from one oracle schema/table to a new schema/table on the same database.

The migration script does the following:

create tab         


        
2条回答
  •  醉话见心
    2021-01-12 23:18

    I've seen similar things to spence7593, again with Pro*C. It is possible to create invalid dates programmatically using a DBMS_STATS package. Not sure if there is a similar mechanism to reverse that.

    create or replace function stats_raw_to_date (p_in raw) return date is
      v_date date;
      v_char varchar2(25);
    begin
      dbms_stats.CONVERT_RAW_VALUE(p_in, v_date);
      return v_date;
    exception
      when others then return null;
    end;
    /
    
    select stats_raw_to_date(utl_raw.cast_to_raw(
              chr(120)||chr(110)||chr(11)||chr(18)||chr(13)||chr(0)||chr(16)))
    from dual;
    

提交回复
热议问题