This discussion is archived
1 Reply Latest reply: Mar 7, 2013 3:17 AM by HamidHelal RSS

how to change merge to update

959406 Newbie
Currently Being Moderated
in this statement change merge to update plz help me

MERGE INTO CORM_QWD_QUOTE_WUTASK A
USING (SELECT * FROM CORM_QMD_QUOTEMAT) B
ON ( ( A.QWD_ORDER_OU = B.QMD_ORDER_OU
AND A.QWD_ORDER_NO = B.QMD_ORDER_NO
AND A.QWD_AMEND_NO = B.QMD_AMEND_NO
AND A.QWD_REF_LINE_NO = B.QMD_REF_LINE_NO
AND A.QWD_TASK_LINE_NO = B.QMD_LINE_NO )
AND A.QWD_ORDER_OU = v_CUSORDEROU_TMP
AND A.QWD_ORDER_NO = v_CUSORDERNO_TMP
AND A.QWD_AMEND_NO = v_CoAmendmentNo_Tmp
AND ( ( v_DesignParamCode04 = 'ACT'
AND A.QWD_QUOT_STATUS NOT IN ( 'PL','C' )
)
OR ( v_DesignParamCode04 'ACT'
AND A.QWD_QUOT_STATUS NOT IN ( 'PENC','PL','C' )
)
) )
WHEN MATCHED THEN UPDATE SET A.QWD_QUOT_STATUS = CASE
WHEN A.QWD_QUOT_STATUS IN ( 'PLM','PM','PMC1','PENC','PL','PM1' )
THEN 'PMC1'--10 Mar 2010

ELSE 'PENMC'
END,
A.QWD_REVISIONNO = CASE v_DESIGNPARAMCODE01_TMP
WHEN 'REST' THEN A.QWD_REVISIONNO + 1
ELSE A.QWD_REVISIONNO
END,
A.QWD_MATQUOT_BASIS = v_DesignParamCode04;

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points