|
把 FETCH c_cur3
INTO row_semi_product;
EXIT WHEN c_cur3%NOTFOUND;
这段删除了,游标改成这样写:
FOR r_cur1 IN c_cur1 LOOP
FOR r_cur3 IN c_cur3(r_cur1.productno1) LOOP
row_semi_product.segment1 := r_cur3.segment1;
row_semi_product.costs_rg := r_cur3.costs_rg;
row_semi_product.costs_sb := r_cur3.costs_sb;
INSERT INTO semi_product_costs VALUES row_semi_product;
DBMS_OUTPUT.ENABLE(1000000);
DBMS_OUTPUT.PUT_LINE(r_cur3.segment1 || ' ' || r_cur3.costs_rg || ' ' ||
r_cur3.costs_sb);
END LOOP;
COMMIT;
END LOOP; |
|