declare cursor c1 is select ITEM_SL, BOM_SL, QTY from bom2,IMAS where imas.sl_no = bom2.item_sl and bom2.bom_sl = :iss.fg_sl and pr_type = :parameter.init2_type and bom2.co_code = :global.co_code order by bom2.type,imas.code; begin if nvl(:iss.fg_sl,0) = 0 then :iss.fg_sl:= g.get_code_rep('bom', :prod_code, :prod_code, :prod_name); end if; go_block('iss2'); clear_block(no_validate); first_record; for i in c1 loop go_block('iss2'); create_record; :iss.fg_sl := i.bom_sl; :iss2.part_sl := i.item_sl; :iss2.reqd_qty := i.qty; end loop; go_block('iss2'); first_record; exception when others then g.cent('err = ' || sqlerrm); end;