[펌글] Oracle Join Update 시 /*+ bypass_ujvc */ 힌트사용

By | 9월 28, 2009

A table 과  b table 를 조인하여 A table의 특정필드에 b table의 특정 필드의 값을
Update 할경우
.

update  /*+ bypass_ujvc */
  (
    SELECT
          a.colnm ra
         ,b.colnm rb   
      FROM a
         , b
     WHERE a.key= b.key
) set ra = rb; 

# 예시) 프로젝트 내의 쿼리 소스

UPDATE /*+ bypass_ujvc */ (SELECT com.conf_stat_tp, com.mod_no, com.mod_dts
                             FROM (SELECT clm.ori_ordclm_no, clmdtl.ord_seq
                                     FROM orderclm clm, orderclmdtl clmdtl
                                    WHERE clm.ordclm_no =
                                                        '20090928135414322650'
                                      AND clm.ordclm_no = clmdtl.ordclm_no) upd,
                                  b_price_compens com
                            WHERE upd.ori_ordclm_no = com.ordclm_no
                              AND upd.ord_seq = com.ord_seq
                              AND com.conf_stat_tp != '03'       --반려는 제외
                                                          )
   SET conf_stat_tp = '04',
       mod_no = 2.108728358e9,
       mod_dts = SYSDATE

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments