반응형
2. Sample
MERGE INTO CRCD_WF_CARD A
USING DUAL
ON ( A.WF_NO = ? AND A.CRD_NO =? )
WHEN MATCHED THEN
UPDATE SET
A.CRD_TYPE =?
, A.FML_SSN =?
, A.FMLHG_NM =?
, A.FMLENG_NM =?
, A.OCRD_NO =?
, A.DSN_CD =?
, A.DSN_NM =?
, A.BRD_CD =?
, A.CRD_GRD =?
, A.INTGLMT_AMT =?
, A.FML_STLACCT_NO =?
, A.CRD_ISSUE_DT =?
WHEN NOT MATCHED THEN
INSERT (
A.WF_NO
, A.CRD_NO
, A.CRD_TYPE
, A.FML_SSN
, A.FMLHG_NM
, A.FMLENG_NM
, A.OCRD_NO
, A.DSN_CD
, A.DSN_NM
, A.BRD_CD
, A.CRD_GRD
, A.INTGLMT_AMT
, A.FML_STLACCT_NO
, A.CRD_ISSUE_DT
) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
2. Sample(1/2)
MERGE INTO HCTB_WORKENV_MATTERS A
USING DUAL
ON ( A.MASTER_IDX = '20100002' AND A.PROC_CODE ='' )
WHEN MATCHED THEN
UPDATE SET
A.MATTER_NAME = 'ㅋㅋㅋ',
A.MATTER_CODE = '00659',
A.MATTER_TYPE = 'useMatter'
WHEN NOT MATCHED THEN
INSERT (
A.MASTER_IDX,
A.FAB_CODE,
A.PROC_CODE,
A.MATTER_NAME,
A.MATTER_CODE,
A.MATTER_TYPE
) VALUES(
'20100002','FAB0001','PROC0002','ㅎㅎㅎㅎ','00659','useMatter'
)
참고 : http://blog.naver.com/zxr_6r?Redirect=Log&logNo=20041210954
MERGE INTO CRCD_WF_CARD A
USING DUAL
ON ( A.WF_NO = ? AND A.CRD_NO =? )
WHEN MATCHED THEN
UPDATE SET
A.CRD_TYPE =?
, A.FML_SSN =?
, A.FMLHG_NM =?
, A.FMLENG_NM =?
, A.OCRD_NO =?
, A.DSN_CD =?
, A.DSN_NM =?
, A.BRD_CD =?
, A.CRD_GRD =?
, A.INTGLMT_AMT =?
, A.FML_STLACCT_NO =?
, A.CRD_ISSUE_DT =?
WHEN NOT MATCHED THEN
INSERT (
A.WF_NO
, A.CRD_NO
, A.CRD_TYPE
, A.FML_SSN
, A.FMLHG_NM
, A.FMLENG_NM
, A.OCRD_NO
, A.DSN_CD
, A.DSN_NM
, A.BRD_CD
, A.CRD_GRD
, A.INTGLMT_AMT
, A.FML_STLACCT_NO
, A.CRD_ISSUE_DT
) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
2. Sample(1/2)
MERGE INTO HCTB_WORKENV_MATTERS A
USING DUAL
ON ( A.MASTER_IDX = '20100002' AND A.PROC_CODE ='' )
WHEN MATCHED THEN
UPDATE SET
A.MATTER_NAME = 'ㅋㅋㅋ',
A.MATTER_CODE = '00659',
A.MATTER_TYPE = 'useMatter'
WHEN NOT MATCHED THEN
INSERT (
A.MASTER_IDX,
A.FAB_CODE,
A.PROC_CODE,
A.MATTER_NAME,
A.MATTER_CODE,
A.MATTER_TYPE
) VALUES(
'20100002','FAB0001','PROC0002','ㅎㅎㅎㅎ','00659','useMatter'
)
참고 : http://blog.naver.com/zxr_6r?Redirect=Log&logNo=20041210954
반응형
'DataBase > oracle' 카테고리의 다른 글
SELECT 로 Query문 만들기 (0) | 2010.04.14 |
---|---|
ORACLE 월별 통계 (1~12월 표현) (2) | 2010.03.15 |
일별 통계 작성법(ORACLE) (0) | 2010.03.13 |
Oracle MERGE INTO(1/1) (0) | 2010.02.07 |
SQL(ORACLE) 여러 행의 특정 컬럼값 -> 하나의 컬럼으로 합치기 (0) | 2010.02.03 |