没啥东西,就记录一下

来源:互联网 发布:java登录功能实现 编辑:程序博客网 时间:2024/05/01 16:20

create or replace procedure w_proc_bankrecvdeal(
    param        integer default -1,
    decrease_num number  default 10000000)
is
    v_seqno    number(18) := 0;
    v_other    varchar2(1000);
    v_decrease number(8)  := decrease_num;
   
    v_total    varchar2(1000);
    v_rid      rowid;

    cursor c_getparam is
    select td.total, td.rowid from tmp_whf_bankrecvdeal td;
begin
    --execute immediate  'truncate table tmp_whf_bankrecvfile';
    open c_getparam;
    fetch c_getparam into v_total, v_rid;

    while c_getparam % found loop
        v_seqno := w_func_getstrpart(v_total, '|', 1);
        v_other := substr(v_total, instr(v_total, '|', 1), length(v_total));

        if    param = -1 then v_seqno := v_seqno - v_decrease;
        elsif param =  1 then v_seqno := v_seqno + v_decrease;
        end if;
       
        update tmp_whf_bankrecvdeal td set td.total = v_seqno || v_other
        where td.rowid = v_rid;
        commit;
       
        fetch c_getparam into v_total, v_rid;
    end loop;
    close c_getparam;
    --open result for
    --select td.total from tmp_whf_bankrecvdeal td;
end w_proc_bankrecvdeal;