表中一個字段加長, 修改程序

1321阅读 1评论2007-05-22 libin1983
分类:

問題:
    表 tf_r_simcard 中字段 rsvalue2 的長度從20變為32. 需要修改文件.
解決方法:
    在定義宏的文件中新增宏
    #define TF_R_SIMCARD_RSVALUE2_LEN 32
    用宏替換文件中定義 tf_r_simcard.rsvalue2 長度的相應部分.
    
查找需要修改的文件:
    step 1: 取包含表 tf_r_simcard 的文件
        grep -i tf_r_simcard *.pc | awk -F: '{ print $1}' > tf_r_simcard.txt
    step 2: 取包含字段 rsvalue2 的文件
        grep -i rsvalue2 *.pc | awk -F: '{ print $1}' > rsvalue2.txt
    step 3: 建表, 存數據  --想確定libin_tmp是否存在, 如存在, 確定是否可以(truncate ~, drop ~) ^^,
        -- Create table
        create table LIBIN_TMP
        (
          FILENAME VARCHAR2(50) not null
        )
        tablespace CBS_DATA01
          pctfree 10
          initrans 1
          maxtrans 255
          storage
          (
            initial 16
            minextents 1
            maxextents unlimited
          );

       
        create table libin_tmp_rs2
          as select * from libin_tmp;
         
        將文件 tf_r_simcard.txt 導入 libin_tmp , 文件 rsvalue2.txt 導入 表 libin_tmp_rs2
    step 4: 取tf_r_simcard.txt, rsvalue2.txt 中數據的交集, 并取出非重復數據
        select distinct a.*
          from libin_tmp a, libin_tmp_rs2 b
         where a.filename = b.filename
        ;
    step 5: 從中(step 4取出的數據)篩選出需要修改的文件.
                                
 
上一篇: [zt]Windows XP 中直接 install Ubuntu / Debian
下一篇:通过脚本读指定的文件