2011년 9월 21일 수요일

MERGE


MERGE
INTO TB_EDU_K_MANJOKDO USING DUAL ON ( CRCL_NO = 'EDU20110901133720449'
      AND YEAR = '2011'
      AND TERM = '199'
      AND KWAMOK_CODE = ''
      AND LCTR_NO = '' ) WHEN MATCHED THEN
UPDATE
SET KWAMOK1 = KWAMOK1 + '0',
  KWAMOK_BIGO = KWAMOK_BIGO || '',
  TEACH1 = TEACH1 + '0',
  TEACH_BIGO = TEACH_BIGO || '',
  MOD_ID = 'F2943B60A2C811D9916ED8B6B5DF9188',
  MOD_DT = sysdate
WHERE CRCL_NO = 'EDU20110901133720449'
  AND YEAR = '2011'
  AND TERM = '199'
  AND KWAMOK_CODE = ''
  AND LCTR_NO = '' WHEN NOT MATCHED THEN
INSERT ( CRCL_NO,
      YEAR,
      TERM,
      REG_ID,
      REG_DT )
VALUES( 'EDU20110901133720449',
      '2011',
      '..',
      sysdate)

댓글 없음:

댓글 쓰기