嗨,伙计们,我有一个 pl/sql 语句,它应该通过游标从一个表中获取数据到另一个表,但是有些字段是空的,我想这就是它退出该行的原因
exit when cursor%not found;
我用谷歌搜索了一下,我看到了在 fetch 语句之后使用该行的建议,但是当你有两个游标但在 Mycase 我有一个游标时似乎就是这种情况。请有人帮我调整这个查询
CREATE OR REPLACE procedure TBAADM.MIGR_EIT
AS
CURSOR cur_eit IS SELECT entity_id, nrml_accrued_amount_cr,nrml_accrued_amount_dr, nrml_booked_amount_cr, nrml_booked_amount_dr, nrml_interest_amount_cr,
nrml_interest_amount_dr,
next_int_run_date_cr ,next_int_run_date_dr ,interest_calc_upto_date_cr, interest_calc_upto_date_dr,xfer_min_bal
,xfer_min_bal_date, booked_upto_date_cr,booked_upto_date_dr FROM TBAADM.eit_temp ;
tempeit1 TBAADM.EIT%ROWTYPE;
number_of_rows_updated number;
BEGIN
number_of_rows_updated:=0;
update tbaadm.eit_temp set entity_id=(select gam.acid from tbaadm.gam where gam.foracid=eit_temp.act_num);
OPEN cur_eit;
LOOP
FETCH cur_eit INTO tempeit1.entity_id,tempeit1.nrml_accrued_amount_cr,tempeit1.nrml_accrued_amount_dr,tempeit1 .nrml_booked_amount_cr,tempeit1.nrml_booked_amount_dr,
tempeit1.nrml_interest_amount_cr, tempeit1.nrml_interest_amount_dr,
tempeit1.next_int_run_date_cr ,tempeit1.next_int_run_date_dr ,tempeit1.interest_calc_upto_date_cr, tempeit1.interest_calc_upto_date_dr,tempeit1.xfer_min_bal
,tempeit1.xfer_min_bal_date, tempeit1.booked_upto_date_cr,tempeit1.booked_upto_date_dr;
exit when cur_eit%notfound;