loop -- BULK COLLECT records fetch cur_get_records bulk collect into v_row_id, v_con_def_seq_nbr, v_run_dt, v_store_nbr, v_rx90_cust_fam_nbr, v_rx90_cust_mbr_nbr, v_rx_nbr, v_rx_fill_nbr, v_fill_dt, v_anti_rf_dt, v_ln limit v_commit_row_cnt; i := v_con_def_seq_nbr.first; if cur_get_records%rowcount > 0 and v_con_def_seq_nbr.exists(i) then -- Delete records from AR_FNL_TBL forall i in v_con_def_seq_nbr.first..v_con_def_seq_nbr.last execute immediate 'delete from ' || v_parm_fnl_tbl || ' where rowid = :1 ' using v_row_id(i); commit; end if; exit when cur_get_records%notfound; end loop;
-- BULK COLLECT records
fetch cur_get_records bulk collect into
v_row_id,
v_con_def_seq_nbr,
v_run_dt,
v_store_nbr,
v_rx90_cust_fam_nbr,
v_rx90_cust_mbr_nbr,
v_rx_nbr,
v_rx_fill_nbr,
v_fill_dt,
v_anti_rf_dt,
v_ln
limit v_commit_row_cnt; i := v_con_def_seq_nbr.first; if cur_get_records%rowcount > 0 and v_con_def_seq_nbr.exists(i)
then -- Delete records from AR_FNL_TBL
forall i in v_con_def_seq_nbr.first..v_con_def_seq_nbr.last
execute immediate 'delete from ' || v_parm_fnl_tbl ||
' where rowid = :1 '
using v_row_id(i); commit; end if; exit when cur_get_records%notfound; end loop;
意思是 跳过当前行下面的代码 继续下一次循环
给个链接
http://blog.csdn.net/wzy0623/archive/2007/07/10/1684344.aspx