大概思路:1. 用过程取日期 19691006
2. update table_name set field_date = to_date('19691006',yyyymmdd') where ...

解决方案 »

  1.   

    update ry_jbxx a set (a.csrq,a.xb)=(select decode(length(sfzhm),18,to_date(substr(sfzhm,7,8),'YYYY-MM-DD'),
    15,to_date('19'||substr(sfzhm,7,6),'YYYY-MM-DD')),decode(length(sfzhm),18,substr(sfzhm,length(sfzhm)-1,1),
    15,substr(sfzhm,length(sfzhm),1)) from ry_jbxx  where a.sfzhm=sfzhm)表名:ry_jbxx 列名:sfzhm为身份证号码 csrq为出生日期
     xb为性别
      

  2.   

    update table_name set birth_day=to_date('19'||substr(id,7,6),'YYYY-MM-DD'),gender=decode(in_str(to_str(to_number(subst(id,length(id),1))/2)),0,'male','female');你自己测试一下
    table_name:你的表名称
    id:身份证字段名称
    birth_day:生日字段
    gender:性别
      

  3.   

    create or replace procdure my_update(chraa in char) as 
      intlen int;
      intVal int;
      chrBir char(8);
      chrMal char(1);
      chrID char(18);
    begin
      chrID := chraa;
      intlen = len(trim(chraa));//取得ID字段的长度
      
      if intlen = 15 then   //判断ID是多少位
        chrBir := substr(chrID,7,6);   //取出出生日期(第七位开始的六个数)
        chrMal := substr(chrID,-1);    //取出性别(最后一位)
      else
        chrBir := substr(chrID,9,6);   //取出出生日期(第九位开始的六个数)
        //先取出后两位,在取出后两位中的前一位(倒数第二位)
        chrMal := substr(substr(chrID,-2),1,1);  
      end if;  //判断年份以便补齐
      intVal := to_number(substr(chrBir,1,2));
      
      if intVal > 4 then //以今年为例,可以修改
        chrBir := '19' || chrBir;
      else
        chrBir := '20' || chrBir;
      end if;  //判断性别位是否是偶数
      if mod(to_number(chrMal),2) = 0 then
        chrMal := F;
      else
        chrMal := M;
      end if;
      
      //修改语句
      update table_name set Birthday=to_date(chrBir,'YYYYMMDD'),Gender=chrMal where ID=chraa;
      commit;//忘了是不是可以提交了
    end;
      

  4.   

    --在这里性别好象没有要求处理.没做处理.
    create procedure pro_test as
        cursor c is select a.user_id, a.identify from user_info a;  --如果表为user_info
        i number(10); --身份证号码的位数
        v_birthday date;  --生日
        identify varchar2(20); --号码
    begin
        open c;
        loop
            fetch c into i,identify;
            exit when c%notfound;
               if length(identify)=15 then --15位的身份证在这里处理
                  v_birthday:=to_date(concat('19',substr('210522741005001',7,6)),'yyyymmdd');
                  --假设2000年后没有15位的号码
               else  --18位的在这里处理
                  v_birthday:=to_date(substr('210522196912060527',7,8),'yyyymmdd');
                  --2000年前的可能有15位也可能有18位的号码         
               end if;
               update user_info b set b.生日字段=v_birthday where b.user_id=i;
               commit;
        end loop;
        close c;
        exception
            when others then 
                rollback;
    end;
      

  5.   

    cuilk(clk) 的非常的对.
     
     up一下.