PROCEDURE gen_rates (nord_id number) IS v_curr number; v_curr2 number; v_avg number; v_avg2 number; v_ge_id tdmmrct.

GE_ID%type; v_ge_id2 tdmmrct.GE_ID%type; Cursor cur_childit is select d.it_code , c.CHILD_IT_CODE,c.QTY_ORD from MDSMORDR d , MDSMPROJECTDET c where d.ORDER_ID=c.ORDER_ID AND d.IT_CODE=c.IT_CODE and d.order_id = nord_id order by d.it_code; Cursor cur_looseit(nCHILD_IT_CODE MDSMPROJECTDET_2.IT_CODE%type) is select l.it_code , l.LOOSE_IT_CODE from MDSMPROJECTDET_2 l where l.IT_CODE=nCHILD_IT_CODE and l.order_id = nord_id order by l.it_code; BEGIN for cit in cur_childit loop begin v_curr := CF_curr_rate(cit.CHILD_IT_CODE); v_avg := CF_avg_rate(cit.CHILD_IT_CODE); v_ge_id := cf_ge_id(cit.CHILD_IT_CODE); update MDSMPROJECTDET set rat_avg = v_avg , rat_curr = v_curr, GE_ID_CURR = v_ge_id where order_id = nord_id and it_code =cit.it_code and CHILD_IT_CODE = cit.CHILD_IT_CODE; :MDSMPROJECTDET.DI_ITGEN := 'CHILD IT CODE'||' : '||cit.CHILD_IT _CODE; synchronize; --error_message('CHILD IT CODE'||' : '||cit.CHILD_IT_CODE); for clit in cur_looseit(cit.CHILD_IT_CODE) loop begin v_curr2 := CF_curr_rate (clit.LOOSE_IT_CODE); v_avg2 := CF_avg_rate(c lit.LOOSE_IT_CODE); v_ge_id2 := cf_ge_id(cl it.LOOSE_IT_CODE); update MDSMPROJECTDET_2 set rat_curr = v_curr2 , rat_avg = v_avg2, GE_ID_CURR = v_ge_id2 where order_id = nord_id and it_code =cit.CHILD_I T_CODE

:MDSMPROJECTDET. synchronize. end loop. end. error_message('Project Costing Generated'). end. end loop.and LOOSE_IT_CODE = clit . --execute_query. --go_block('MHSMORDR'). end. begin update MHSMORDR set RATE_GEN_DT = sysdate where order_id = nord_id. END. .DI_ITGEN := ''.LOOSE_IT_CODE. post_Data.

Sign up to vote on this title
UsefulNot useful