zoukankan      html  css  js  c++  java
  • 批量数据清理

    DECLARE
    CURSOR c_partition IS
    SELECT rowid FROM cmp_credit_gimap_publicno_prot partition(PART_CCGPP_0) WHERE IM_TYPE = '06';
    type t_type is table of rowid index by pls_integer;
    v_rowid t_type;

    p_err_code NUMBER;
    p_err_message VARCHAR2(4000);
    l_update_cnt NUMBER(12) := 0;
    l_start DATE;
    l_end DATE;
    l_seq NUMBER(12);
    v_limit NUMBER := 50000;

    BEGIN
    l_start := SYSDATE;
    l_seq := 0;
    OPEN c_partition;
    LOOP
    FETCH c_partition BULK COLLECT INTO v_rowid LIMIT v_limit;
    EXIT WHEN v_rowid.count = 0;
    FORALL j IN 1 .. v_rowid.COUNT
    DELETE FROM cmp_credit_gimap_publicno_prot where rowid = v_rowid(j);
    l_update_cnt := l_update_cnt + SQL%ROWCOUNT;
    l_seq := l_seq + 1;
    INSERT INTO cmp_solix_log
    (table_name, seq_no, begin_time, end_time, cnt)
    VALUES
    ('CMP_CREDIT_GIMAP_PUBLICNO_PROT_0', l_seq, l_start, SYSDATE, l_update_cnt);
    COMMIT;
    EXIT WHEN c_partition%NOTFOUND;
    END LOOP;
    CLOSE c_partition;
    EXCEPTION
    WHEN OTHERS THEN
    p_err_code := SQLCODE;
    p_err_message := SQLERRM;
    ROLLBACK;
    INSERT INTO cmp_solix_log
    (table_name, seq_no, begin_time, end_time, cnt, err_code, err_message)
    VALUES
    ('CMP_CREDIT_GIMAP_PUBLICNO_PROT_ERR_0', l_seq, l_start, SYSDATE, l_update_cnt, p_err_code, p_err_message);
    COMMIT;
    END;
    /

  • 相关阅读:
    HBA登录验证
    html转pdf
    html转pdf
    html转word
    python生成html
    python生成pdf
    Word另存为不同的格式
    WORD转HTML-python第三方包Mammoth(官方文档翻译)
    深入浅谈,CPU设计原理
    CPU,寄存器,缓存,RAM,ROM的作用和他们之间的联系
  • 原文地址:https://www.cnblogs.com/zszitman/p/6483332.html
Copyright © 2011-2022 走看看