PL/SQL存儲過程-中國電力基本檔案存儲功能

来源:http://www.cnblogs.com/Jepson1218/archive/2016/02/02/5178761.html
-Advertisement-
Play Games

CREATE OR REPLACE PACKAGE BODY BASE_INFO AS PROCEDURE insert_lapc(lapc In lapc_array) AS v_max number; v_result number; v_status number; BEGIN delete


CREATE OR REPLACE PACKAGE BODY BASE_INFO AS   PROCEDURE insert_lapc(lapc In lapc_array) AS     v_max number;     v_result number;     v_status number;   BEGIN     delete from TMP_LAPC;     v_result := -10;     --數據插入臨時表     FOR i IN lapc.FIRST .. lapc.LAST LOOP       BEGIN         insert into tmp_lapc           (lapc_id,            customer_id,            lapc_name,            sort,            lapc_addr,            tel,            cons_sort_code,            ms_mode,            trade_code,            volt_code,            lode_attr_code,            contract_cap,            status_code,            vip_code,            line_id,            powersupplyofficeid,            townid)         values           (lapc(i).lapc_id,            lapc(i).customer_id,            lapc(i).lapc_name,            lapc(i).sort,            lapc(i).lapc_addr,            lapc(i).tel,            lapc(i).cons_sort_code,            lapc(i).ms_mode,            lapc(i).trade_code,            lapc(i).volt_code,            lapc(i).lode_attr_code,            lapc(i).contract_cap,            lapc(i).status_code,            lapc(i).vip_code,            lapc(i).line_id,            lapc(i).powersupplyofficeid,            lapc(i).townid);       END;     END LOOP;     v_result := -20;     --代碼轉換     update tmp_lapc a        set a.line_id_new =            (select b.line_id               from g_line b              where a.line_id = b.guid                and rownum = 1);     update tmp_lapc a        set a.townid_new =            (select b.org_no               from O_ORG b              where a.townid = b.guid                and rownum = 1);     update tmp_lapc a        set a.group_id =            (select b.org_no               from O_ORG b              where a.powersupplyofficeid = b.guid                and rownum = 1);     update tmp_lapc a        set a.consid =            (select b.cons_id               from C_CONS b              where a.lapc_id = b.guid                and rownum = 1);     v_result := -30;     -- delete from tmp_lapc a where a.townid_new is null;     -- delete from tmp_lapc a where a.line_id_new is null;     --更新正式表     update C_CONS a        set (a.cons_id,             a.cons_name,             a.cons_no,             a.cons_addr,             a.tel1,             a.CONS_SORT_CODE,             a.meas_mode,             a.trade_code,             a.volt_code,             a.lode_attr_code,             a.contract_cap,             a.status_code,             a.vip_code,             a.line_id,             a.org_no,             a.area_code,             a.savedatetime,             a.power_type_code) =            (select b.consid,                    b.lapc_name,                    b.customer_id,                    b.lapc_addr,                    b.tel,                    '01',                    b.MS_MODE,                    b.trade_code,                    b.volt_code,                    b.lode_attr_code,                    b.contract_cap,                    b.status_code,                    b.vip_code,                    b.line_id_new,                    b.group_id,                    b.townid_new,                    sysdate,                    b.cons_sort_code               from tmp_lapc b              where a.cons_id = b.consid                and rownum = 1)      where exists (select 1 from tmp_lapc b where a.cons_id = b.consid);     v_result := -40;     --刪除更新完的數據     delete from tmp_lapc a where a.consid is not null;     --插入正式表(只支持單線程)     select nvl(max(cons_id), 0) into v_max from c_cons;     insert into c_cons a       (a.cons_id,        a.cons_name,        a.cons_no,        a.cons_addr,        a.tel1,        a.CONS_SORT_CODE,        a.meas_mode,        a.trade_code,        a.volt_code,        a.lode_attr_code,        a.contract_cap,        a.status_code,        a.vip_code,        a.line_id,        a.org_no,        a.area_code,        a.guid,        a.savedatetime)       select v_max + rownum,              b.lapc_name,              b.customer_id,              b.lapc_addr,              b.tel,              b.cons_sort_code,              b.MS_MODE,              b.trade_code,              b.volt_code,              b.lode_attr_code,              b.contract_cap,              b.status_code,              b.vip_code,              b.line_id_new,              b.group_id,              b.townid_new,              b.lapc_id,              sysdate         from tmp_lapc b;     commit;   EXCEPTION     WHEN OTHERS THEN       begin         ROLLBACK;         v_status := ERROR_LOG(v_result, SQLCODE, SQLERRM, 'insert_lapc');       end;   END insert_lapc;     PROCEDURE insert_amsm(amsm In amsm_array) AS     v_max number;     v_result number;     v_status number;   BEGIN     delete from TMP_AMSM;     --數據插入臨時表     v_result := -10;     FOR i IN amsm.FIRST .. amsm.LAST LOOP       BEGIN         insert into tmp_amsm           (mped_id,            mped_name,            volt_code,            cons_id,            tgid,            subs_id,            mp_type,            trade_code,            side_code,            switch_no,            total_flag,            meas_mode,            wiring_mode,            m_mped_id,            status_code,            pt_value,            ct_value,            t_factor,            mp_calc_mode,            cons_mp_calc_mode,            powersupplyofficeid,            groupid)         values           (amsm(i).mped_id,            amsm(i) . mped_name,            amsm(i).volt_code,            amsm(i).cons_id,            amsm(i).tgid,            amsm(i).subs_id,            decode(amsm(i).mp_type,'02','03','03','02',amsm(i).mp_type),            amsm(i).trade_code,            amsm(i).side_code,            amsm(i).switch_no,            amsm(i).total_flag,            amsm(i).meas_mode,            amsm(i).wiring_mode,            amsm(i).m_mped_id,            amsm(i).status_code,            amsm(i).pt_value,            amsm(i).ct_value,            amsm(i).t_factor,            amsm(i).mp_calc_mode,            amsm(i).cons_mp_calc_mode,            amsm(i).powersupplyofficeid,            amsm(i).groupid);       END;     END LOOP;     --代碼轉換     v_result := -20;     update tmp_amsm a        set a.SUBS_ID_NEW =            (select b.subs_id               from g_subs b              where b.guid = a.subs_id                and rownum = 1);       update tmp_amsm a        set a.mped_id_new =            (select b.mped_id               from p_mped b              where b.guid = a.mped_id                and rownum = 1);       update tmp_amsm a        set a.m_mped_id_new =            (select b.mped_id               from p_mped b              where b.guid = a.m_mped_id                and rownum = 1);       update tmp_amsm a        set a.org_no =            (select b.org_no               from o_org b              where b.guid = a.powersupplyofficeid                and rownum = 1);     update tmp_amsm a        set a.area_code =            (select b.org_no               from o_org b              where b.guid = a.groupid                and rownum = 1);       update tmp_amsm a        set a.cons_id_new =            (select b.cons_id               from c_cons b              where b.guid = a.cons_id                and rownum = 1);     v_result := -30;     --更新正式表     update P_MPED a        set (MPED_NAME,             CT_VALUE,             PT_VALUE,             M_MPED_ID,             VOLT_TYPE,             SIDE_CODE,             SUBS_ID,             STATUS_CODE,             CONS_ID,             MP_TYPE,             TRADE_CODE,             SWITCH_NO,             MAIN_FLAG,             MEAS_MODE,             WIRING_MODE,             MP_CALC_MODE,             MP_CALC_TYPE,             ORG_NO,             AREA_CODE,             SAVEDATETIME,             Mped_Prop) =            (select b.mped_name,                    b.ct_value,                    b.pt_value,                    b.m_mped_id_new,                    b.volt_code,                    b.side_code,                    b.subs_id_new,                    b.status_code,                    b.cons_id_new,                    b.mp_type,                    b.trade_code,                    b.switch_no,                    b.total_flag,                    b.meas_mode,                    b.wiring_mode,                    b.mp_calc_mode,                    b.CONS_MP_CALC_MODE,                    b.org_no,                    b.area_code,                    sysdate,                    '02'               from tmp_amsm b              where a.mped_id = b.mped_id_new                and rownum = 1)      where exists      (select 1 from tmp_amsm b where a.mped_id = b.mped_id_new);     --刪除更新完的數據     v_result := -40;     delete from tmp_amsm a where a.mped_id_new is not null;     --插入正式表(只支持單線程)     select nvl(max(a.mped_id), 0) into v_max from p_mped a;     insert into P_MPED a       (MPED_ID,        MPED_NAME,        CT_VALUE,        PT_VALUE,        M_MPED_ID,        VOLT_TYPE,        SIDE_CODE,        SUBS_ID,        STATUS_CODE,        CONS_ID,        MP_TYPE,        TRADE_CODE,        SWITCH_NO,        MAIN_FLAG,        MEAS_MODE,        WIRING_MODE,        MP_CALC_MODE,        MP_CALC_TYPE,        ORG_NO,        AREA_CODE,        SAVEDATETIME,        guid,        Mped_Prop)       select v_max + rownum,              b.mped_name,              b.ct_value,              b.pt_value,              b.m_mped_id_new,              b.volt_code,              b.side_code,              b.subs_id_new,              b.status_code,              b.cons_id_new,              b.mp_type,              b.trade_code,              b.switch_no,              b.total_flag,              b.meas_mode,              b.wiring_mode,              b.mp_calc_mode,              b.CONS_MP_CALC_MODE,              b.org_no,              b.area_code,              sysdate,              b.mped_id,              '02'         from tmp_amsm b;       commit;   EXCEPTION     WHEN OTHERS THEN       begin         ROLLBACK;         v_status := ERROR_LOG(v_result, SQLCODE, SQLERRM, 'insert_amsm');       end;   END insert_amsm;     PROCEDURE insert_amso(amso In amso_array) AS     v_max number;     v_result number;     v_status number;   BEGIN     delete from TMP_AMSO;     v_result := -10;     --數據插入臨時表     FOR i IN amso.FIRST .. amso.LAST LOOP       BEGIN         insert into TMP_AMSO           (POWERSUPPLYOFFICEID, POWERSUPPLYOFFICENAME, COUNTYID)         values           (amso(i).POWERSUPPLYOFFICEID,            amso(i).POWERSUPPLYOFFICENAME,            amso(i).COUNTYID);       END;     END LOOP;     v_result := -20;     --代碼轉換     update TMP_AMSO a        set a.org_no =            (select b.org_no               from o_org b              where b.guid = a.powersupplyofficeid                and rownum = 1);       update TMP_AMSO a        set a.p_org_no =            (select b.org_no               from o_org b              where b.guid = a.countyid                and rownum = 1);     v_result := -30;     --更新正式表     update o_org a        set (a.org_name, a.p_org_no, a.org_type, a.savedatetime) =            (select b.powersupplyofficename, b.p_org_no, '06', sysdate               from TMP_AMSO b              where a.org_no = b.org_no)      where exists (select 1 from TMP_AMSO b where a.org_no = b.org_no);     update o_org a        set a.org_path =            (select b.org_path || '\' || a.org_no               from o_org b              where a.p_org_no = b.org_no)      where exists (select 1 from TMP_AMSO b where a.org_no = b.org_no);     v_result := -40;     --刪除更新完的數據     delete from TMP_AMSO a where a.org_no is not null;     --插入正式表(只支持單線程)     select nvl(max(to_number(a.org_no)), 0) into v_max from o_org a;     insert into o_org a       (a.org_no,        a.org_name,        a.p_org_no,        a.org_type,        a.savedatetime,        a.guid)       (select v_max + rownum,               b.powersupplyofficename,               b.p_org_no,               '06',               sysdate,               b.powersupplyofficeid          from TMP_AMSO b);       update o_org a        set a.org_path =            (select b.org_path || '\' || a.org_no               from o_org b              where a.p_org_no = b.org_no)      where exists      (select 1 from TMP_AMSO b where a.GUID = b.powersupplyofficeid);       commit;   EXCEPTION     WHEN OTHERS THEN       begin         ROLLBACK;         v_status := ERROR_LOG(v_result, SQLCODE, SQLERRM, 'insert_amso');       end;   END insert_amso;     PROCEDURE insert_tmrs(tmrs In tmrs_array) AS     v_max number;     --v_str varchar2(1000);     v_result number;     v_status number;   BEGIN     delete from tmp_tmrs;     v_result := -10;     --數據插入臨時表     FOR i IN tmrs.FIRST .. tmrs.LAST LOOP       BEGIN         insert into tmp_tmrs           (stationid,            stationname,            stationaddress,            voltagegrade,            zoneid,            status,            stationtype,            prop,            losstarget,            theoryloss,            product_company_id)         values           (tmrs(i).stationid,            tmrs(i).stationname,            tmrs(i).stationaddress,            tmrs(i).voltagegrade,            tmrs(i).zoneid,            tmrs(i).status,            tmrs(i).stationtype,            tmrs(i).prop,            tmrs(i).losstarget,            tmrs(i).theoryloss,            tmrs(i).product_company_id);       END;     END LOOP;     v_result := -20;     --代碼轉換     update tmp_tmrs a        set a.org_no =            (select b.org_no               from o_org b              where b.guid = a.zoneid                and rownum = 1);       update tmp_tmrs a        set a.area_code =            (select b.org_no               from o_org b              where b.guid = a.groupid                and rownum = 1);       update tmp_tmrs a        set a.subs_id =            (select b.subs_id               from g_subs b              where b.guid = a.stationid                and rownum = 1);     v_result := -30;     --更新正式表     update G_SUBS a        set (SUBS_NAME,             SUBS_ADDR,             ORG_NO,             VOLT_CODE,             RUN_STATUS_CODE,             SUBS_TYPE,             SUBS_PROP,             SAVEDATETIME) =            (select b.stationname,                    b.stationaddress,                    b.org_no,                    b.voltagegrade,                    b.status,                    b.stationtype,                    b.prop,                    sysdate               from tmp_tmrs b              where a.subs_id = b.subs_id                and rownum = 1)      where exists (select 1 from tmp_tmrs b where a.subs_id = b.subs_id);     v_result := -40;     --刪除更新完的數據     delete from tmp_tmrs a where a.subs_id is not null;     --插入正式表(只支持單線程)     select nvl(max(a.subs_id), 0) into v_max from G_SUBS a;     insert into G_SUBS a       (SUBS_ID,        SUBS_NAME,        SUBS_ADDR,        ORG_NO,        VOLT_CODE,        RUN_STATUS_CODE,        SUBS_TYPE,        SUBS_PROP,        SAVEDATETIME,        GUID)       (select v_max + rownum,               b.stationname,               b.stationaddress,               b.org_no,               b.voltagegrade,               b.status,               b.stationtype,               b.prop,               sysdate,               b.stationid          from tmp_tmrs b);       commit;   EXCEPTION     WHEN OTHERS THEN       begin         ROLLBACK;         v_status := ERROR_LOG(v_result, SQLCODE, SQLERRM, 'insert_tmrs');       end;   END insert_tmrs;     PROCEDURE insert_amsl(amsl In amsl_array) AS     v_max number;     v_max1 number;     v_result number;     v_status number;   BEGIN     delete from tmp_amsl;     v_result := -10;     --數據插入臨時表     FOR i IN amsl.FIRST .. amsl.LAST LOOP       BEGIN         insert into tmp_amsl           (lineid,            linename,            linetype,            voltagegrade,            stationid,            losstarget,            theoryloss,            statusflag,            zoneid,            groupid)         values           (amsl(i).lineid,            amsl(i).linename,            amsl(i).linetype,            amsl(i).voltagegrade,            amsl(i).stationid,            amsl(i).losstarget,            amsl(i).theoryloss,            amsl(i).statusflag,            amsl(i).zoneid,            amsl(i).groupid);       END;     END LOOP;     v_result := -20;     --代碼轉換     update tmp_amsl a        set a.org_no =            (select b.org_no               from o_org b              where b.guid = a.zoneid                and rownum = 1);       update tmp_amsl a        set a.area_code =            (select b.org_no               from o_org b              where b.guid = a.groupid                and rownum = 1);       update tmp_amsl a        set a.subs_id =            (select b.subs_id               from g_subs b              where b.guid = a.stationid                and rownum = 1);       update tmp_amsl a        set a.line_id =            (select b.line_id               from g_line b              where b.guid = a.lineid                and rownum = 1);     v_result := -30;     --更新正式表     update G_LINE a        set (LINE_NAME,             LINE_TYPE,             VOLT_CODE,             RUN_STATUS_CODE,             ORG_NO,             AREA_CODE,             SAVEDATETIME) =            (select b.linename,                    decode(b.linetype, '1', '01', '2', '02', '03'),                    b.voltagegrade,                    b.statusflag,                    b.org_no,                    b.area_code,                    sysdate               from tmp_amsl b              where a.line_id = b.line_id                and rownum = 1)      where exists (select 1 from tmp_amsl b where a.line_id = b.line_id);       delete from g_subs_line_rela a      where exists (select 1               from tmp_amsl b              where a.line_id = b.line_id);       /* update g_subs_line_rela a       set (a.line_id, a.subs_id, a.savedatetime) =           (select b.line_id, b.subs_id, sysdate              from tmp_amsl b             where a.line_id = b.line_id               and a.subs_id = b.subs_id               and rownum = 1)     where exists (select 1              from tmp_amsl b             where a.line_id = b.line_id               and a.subs_id = b.subs_id);*/     select nvl(max(a.rela_id), 0) into v_max1 from g_subs_line_rela a;       insert into g_subs_line_rela       (rela_id,        line_id,        subs_id,        in_out_flag,        rela_flag,        run_status_code,        savedatetime)       (select v_max1 + rownum, b.line_id, b.subs_id, '', '', '01', sysdate          from tmp_amsl b);     v_result := -40;     --刪除更新完的數據     delete from tmp_amsl a where a.line_id is not null;     --插入正式表(只支持單線程)     select nvl(max(a.line_id), 0) into v_max from g_line a;     select nvl(max(a.rela_id), 0) into v_max1 from g_subs_line_rela a;       insert into g_line a       (line_id,        LINE_NAME,        LINE_TYPE,        VOLT_CODE,        RUN_STATUS_CODE,        ORG_NO,        AREA_CODE,        SAVEDATETIME,        GUID)       (select v_max + rownum,               b.linename,               decode(b.linetype, '1', '01', '2', '02', '03'),               b.voltagegrade,               b.statusflag,               b.org_no,               b.area_code,               sysdate,               b.lineid          from tmp_amsl b);     update tmp_amsl a        set a.line_id =            (select b.line_id               from g_line b              where b.guid = a.lineid                and rownum = 1);     insert into g_subs_line_rela       (rela_id,        line_id,        subs_id,        in_out_flag,        rela_flag,        run_status_code,        savedatetime)       (select v_max1 + rownum, b.line_id, b.subs_id, '', '', '01', sysdate          from tmp_amsl b);     commit;   EXCEPTION     WHEN OTHERS THEN       begin         ROLLBACK;         v_status := ERROR_LOG(v_result, SQLCODE, SQLERRM, 'insert_amsl');       end;   END insert_amsl;     PROCEDURE insert_tmrz(tmrz In tmrz_array) AS     v_max number;     v_result number;     v_status number;   BEGIN     delete from tmp_tmrz;     v_result := -10;     --數據插入臨時表     FOR i IN tmrz.FIRST .. tmrz.LAST LOOP       BEGIN         insert into tmp_tmrz           (transformerid,            transformername,            transformertype,            capacity,            stationid,            voltagegrade,            zoneid,            losstarget,            theoryloss,            statusflag,            groupid)         values           (tmrz(i).transformerid,            tmrz(i).transformername,            tmrz(i).transformertype,            tmrz(i).capacity,            tmrz(i).stationid,            tmrz(i).voltagegrade,            tmrz(i).zoneid,            tmrz(i).losstarget,            tmrz(i).theoryloss,            tmrz(i).statusflag,            tmrz(i).groupid);       END;     END LOOP;     /* insert into test2 (select count(1) from tmp_tmrz);     commit;*/     v_result := -20;     --代碼轉換     update tmp_tmrz a        set a.org_no =            (select b.org_no               from o_org b              where b.guid = a.zoneid                and rownum = 1);       update tmp_tmrz a        set a.area_code =            (select b.org_no               from o_org b              where b.guid = a.groupid                and rownum = 1);       update tmp_tmrz a        set a.subs_id =            (select b.subs_id               from g_subs b              where b.guid = a.stationid                and rownum = 1);       update tmp_tmrz a        set a.tran_id =            (select b.tran_id               from g_tran b              where b.guid = a.transformerid                and rownum = 1);     v_result := -30;     --更新正式表     update G_TRAN a        set (TRAN_NAME,             SUBS_ID,             ORG_NO,             RATED_VOLT,             PLATE_CAP,             PUB_PRIV_FLAG,             area_code,             SAVEDATETIME) =            (select b.transformername,                    b.subs_id,                    b.org_no,                    b.voltagegrade,                    b.capacity,                    '1',                    b.area_code,                    sysdate               from tmp_tmrz b              where a.tran_id = b.tran_id                and rownum = 1)      where exists (select 1 from tmp_tmrz b where a.tran_id = b.tran_id);     v_result := -40;     --刪除更新完的數據     delete from tmp_tmrz a where a.tran_id is not null;     --插入正式表(只支持單線程)     select nvl(max(a.tran_id), 0) into v_max from G_TRAN a;     insert into G_TRAN a       (tran_id,        TRAN_NAME,        SUBS_ID,        ORG_NO,        RATED_VOLT,        PLATE_CAP,        PUB_PRIV_FLAG,        area_code,        SAVEDATETIME,        guid)       (select v_max + rownum,               b.transformername,               b.subs_id,               b.org_no,               b.voltagegrade,               b.capacity,               '2',               b.area_code,               sysdate,               b.transformerid          from tmp_tmrz b);       commit;   EXCEPTION     WHEN OTHERS THEN       begin         ROLLBACK;         v_status := ERROR_LOG(v_result, SQLCODE, SQLERRM, 'insert_tmrz');       end;   END insert_tmrz;     PROCEDURE insert_lapt(lapt In lapt_array) AS     v_max number;     v_result number;     v_status number;   BEGIN     delete from tmp_lapt;     v_result := -10;     --數據插入臨時表     FOR i IN lapt.FIRST .. lapt.LAST LOOP       BEGIN         insert into tmp_lapt           (transformerid,            consumerid,            transformertype,            tgid,            capacity,            address,            longitude,            latitude,            supplylineno,            zoneid,            groupid)         values           (lapt(i).transformerid,            lapt(i).consumerid,            lapt(i).transformertype,            lapt(i).tgid,            lapt(i).capacity,            lapt(i).address,            lapt(i).longitude,            lapt(i).latitude,            lapt(i).supplylineno,            lapt(i).zoneid,            lapt(i).groupid);       END;     END LOOP;     v_result := -20;     --代碼轉換     update tmp_lapt a        set a.org_no =            (select b.org_no               from o_org b              where b.guid = a.zoneid                and rownum = 1);       update tmp_lapt a        set a.area_code =            (select b.org_no               from o_org b              where b.guid = a.groupid                and rownum = 1);       update tmp_lapt a        set a.tg_id =            (select b.tg_id               from g_tg b              where b.guid = a.tgid                and rownum = 1);     update tmp_lapt a        set a.cons_id =            (select b.cons_id               from c_cons b              where b.guid = a.consumerid                and rownum = 1);       update tmp_lapt a        set a.tran_id =            (select b.tran_id               from g_tran b              where b.guid = a.transformerid                and rownum = 1);     v_result := -30;     --更新正式表     update G_TRAN a        set (TG_ID,             ORG_NO,             PLATE_CAP,             PUB_PRIV_FLAG,             CONS_ID,             INST_ADDR,             area_code,             SAVEDATETIME) =            (select b.tg_id,                    b.org_no,                    b.capacity,                    b.transformertype,                    b.cons_id,                    b.address,                    b.area_code,                    sysdate               from tmp_lapt b              where a.tran_id = b.tran_id                and rownum = 1)      where exists (select 1 from tmp_lapt b where a.tran_id = b.tran_id);     v_result := -40;     --刪除更新完的數據     delete from tmp_lapt a where a.tran_id is not null;     --插入正式表(只支持單線程)     select nvl(max(a.tran_id), 0) into v_max from G_TRAN a;     insert into G_TRAN a       (tran_id,        TG_ID,        ORG_NO,        PLATE_CAP,        PUB_PRIV_FLAG,        CONS_ID,        INST_ADDR,        area_code,        SAVEDATETIME,        guid)       (select v_max + rownum,               b.tg_id,               b.org_no,               b.capacity,               b.transformertype,               b.cons_id,               b.address,               b.area_code,               sysdate,               b.transformerid          from tmp_lapt b);       commit;   EXCEPTION     WHEN OTHERS THEN       begin         ROLLBACK;         v_status := ERROR_LOG(v_result, SQLCODE, SQLERRM, 'insert_tmrz');       end;   END insert_lapt;     PROCEDURE insert_dmrt(dmrt In dmrt_array) AS     v_max number;     v_result number;     v_status number;     v_max1 number;     BEGIN     delete from tmp_dmrt;     v_result := -10;     --數據插入臨時表     FOR i IN dmrt.FIRST .. dmrt.LAST LOOP       BEGIN         insert into tmp_dmrt           (TGID, TGNAME, CONSNUM, ZONEID, GROUPID, SUPPLYLINENO)         values           (dmrt(i).TGID,            dmrt(i).TGNAME,            dmrt(i).CONSNUM,            dmrt(i).ZONEID,            dmrt(i).GROUPID,            dmrt(i).SUPPLYLINENO);       END;     END LOOP;     v_result := -20;     --代碼轉換     update tmp_dmrt a        set a.org_no =            (select b.org_no               from o_org b              where b.guid = a.zoneid                and rownum = 1); &nbs
您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 1、eclipse關聯源碼 步驟一:自已百度下載相應版本的源碼,我這裡是4.2也就是API=17的版本。 步驟二:找到你安裝sdk的目錄, G:\Program Files\adt-bundle-windows-x86\sdk\platforms\android-4.2 步驟三:在這個目錄下新建一個
  • 通訊錄導航欄源碼: 1.activity 1 package com.anna.contact.activity; 2 3 import java.util.ArrayList; 4 import java.util.HashMap; 5 import java.util.List; 6 7 imp
  • iPhone中GPS定位如何使用 關鍵詞 1.info.plist配置授權描述 2.引入庫 3.CLLocationManager的使用 info.plist配置 在info.plist中根據情況加入以下兩個string類型配置項,並填寫描述 1.NSLocationAlwaysUsageDescr
  • 緣由: 平時工作,因為懶於動筆的原因,也沒註重技術和經驗的積累,導致之前曾經研究過的問題現在又忘記了,所以要慢慢註重積累,那麼就從寫作開始,談談對工作中碰到的問題進行整理和歸納。 我們都知道,在Android中,想處理事件傳遞,可以用Handler+MessageQueue+Message+Loop
  • STPopup 為 iPhone 和 iPad提供了 STPopupController UINavigationController 彈出的風格。 特性: Extend your view controller from UIViewController, build it in your fam
  • 筆記,listview視圖總結 1 public class HomeEduMoreAdapter extends BaseAdapter { 2 3 private final String TAG = "HomeEduMoreAdapter"; 4 5 private static final
  • 1 package com.gzcivil.utils; 2 3 /** 4 * 同StringBuffer 5 * 6 * @author Dragon 7 * @time 2013-3-1 8 */ 9 public class StrBuffer { 10 private StringBuff
  • 本文內容 創建 MySQL 用戶和組 解壓 MySQL 源代碼包 生成配置安裝文件 編譯和安裝 MySQL 配置文件 創建 MySQL 授權表 授權 啟動 MySQL 驗證安裝 設置訪問許可權 MySQL 開機自動啟動 最近做項目,出了一個事:之前我是用 Oracle 的,如果在 Windows 環境
一周排行
    -Advertisement-
    Play Games
  • 基於.NET Framework 4.8 開發的深度學習模型部署測試平臺,提供了YOLO框架的主流系列模型,包括YOLOv8~v9,以及其系列下的Det、Seg、Pose、Obb、Cls等應用場景,同時支持圖像與視頻檢測。模型部署引擎使用的是OpenVINO™、TensorRT、ONNX runti... ...
  • 十年沉澱,重啟開發之路 十年前,我沉浸在開發的海洋中,每日與代碼為伍,與演算法共舞。那時的我,滿懷激情,對技術的追求近乎狂熱。然而,隨著歲月的流逝,生活的忙碌逐漸占據了我的大部分時間,讓我無暇顧及技術的沉澱與積累。 十年間,我經歷了職業生涯的起伏和變遷。從初出茅廬的菜鳥到逐漸嶄露頭角的開發者,我見證了 ...
  • C# 是一種簡單、現代、面向對象和類型安全的編程語言。.NET 是由 Microsoft 創建的開發平臺,平臺包含了語言規範、工具、運行,支持開發各種應用,如Web、移動、桌面等。.NET框架有多個實現,如.NET Framework、.NET Core(及後續的.NET 5+版本),以及社區版本M... ...
  • 前言 本文介紹瞭如何使用三菱提供的MX Component插件實現對三菱PLC軟元件數據的讀寫,記錄了使用電腦模擬,模擬PLC,直至完成測試的詳細流程,並重點介紹了在這個過程中的易錯點,供參考。 用到的軟體: 1. PLC開發編程環境GX Works2,GX Works2下載鏈接 https:// ...
  • 前言 整理這個官方翻譯的系列,原因是網上大部分的 tomcat 版本比較舊,此版本為 v11 最新的版本。 開源項目 從零手寫實現 tomcat minicat 別稱【嗅虎】心有猛虎,輕嗅薔薇。 系列文章 web server apache tomcat11-01-官方文檔入門介紹 web serv ...
  • 1、jQuery介紹 jQuery是什麼 jQuery是一個快速、簡潔的JavaScript框架,是繼Prototype之後又一個優秀的JavaScript代碼庫(或JavaScript框架)。jQuery設計的宗旨是“write Less,Do More”,即倡導寫更少的代碼,做更多的事情。它封裝 ...
  • 前言 之前的文章把js引擎(aardio封裝庫) 微軟開源的js引擎(ChakraCore))寫好了,這篇文章整點js代碼來測一下bug。測試網站:https://fanyi.youdao.com/index.html#/ 逆向思路 逆向思路可以看有道翻譯js逆向(MD5加密,AES加密)附完整源碼 ...
  • 引言 現代的操作系統(Windows,Linux,Mac OS)等都可以同時打開多個軟體(任務),這些軟體在我們的感知上是同時運行的,例如我們可以一邊瀏覽網頁,一邊聽音樂。而CPU執行代碼同一時間只能執行一條,但即使我們的電腦是單核CPU也可以同時運行多個任務,如下圖所示,這是因為我們的 CPU 的 ...
  • 掌握使用Python進行文本英文統計的基本方法,並瞭解如何進一步優化和擴展這些方法,以應對更複雜的文本分析任務。 ...
  • 背景 Redis多數據源常見的場景: 分區數據處理:當數據量增長時,單個Redis實例可能無法處理所有的數據。通過使用多個Redis數據源,可以將數據分區存儲在不同的實例中,使得數據處理更加高效。 多租戶應用程式:對於多租戶應用程式,每個租戶可以擁有自己的Redis數據源,以確保數據隔離和安全性。 ...