728x90

DROP TRIGGER AC_NPUS.TR_MAN_CAREER_LOG;

CREATE OR REPLACE TRIGGER AC_NPUS.TR_MAN_CAREER_LOG AFTER
INSERT OR UPDATE OR DELETE ON AC_NPUS.MAN_CAREER FOR EACH ROW
BEGIN
IF INSERTING THEN
INSERT INTO MAN_CAREER_LOG
(
AD_ID ,
CAR_SEQ ,
CAR_NM ,
CAR_DT_BE ,
CAR_DT_AF ,
CAR_POINT ,
CAR_POSITION ,
USE_YN ,
CAR_SORT ,
INS_DT ,
INS_ID ,
UPD_DT ,
UPD_ID ,
LOG_UPDATE_DATE,
LOG_UPDATE_MODE
)
VALUES
(
:NEW.AD_ID ,
:NEW.CAR_SEQ ,
:NEW.CAR_NM ,
:NEW.CAR_DT_BE ,
:NEW.CAR_DT_AF ,
:NEW.CAR_POINT ,
:NEW.CAR_POSITION ,
:NEW.USE_YN ,
:NEW.CAR_SORT ,
:NEW.INS_DT ,
:NEW.INS_ID ,
:NEW.UPD_DT ,
:NEW.UPD_ID ,
SYSDATE ,
'I'
);
END IF;

IF UPDATING THEN
INSERT INTO MAN_CAREER_LOG
(
AD_ID ,
CAR_SEQ ,
CAR_NM ,
CAR_DT_BE ,
CAR_DT_AF ,
CAR_POINT ,
CAR_POSITION ,
USE_YN ,
CAR_SORT ,
INS_DT ,
INS_ID ,
UPD_DT ,
UPD_ID ,
LOG_UPDATE_DATE,
LOG_UPDATE_MODE
)
VALUES
(
:NEW.AD_ID ,
:NEW.CAR_SEQ ,
:NEW.CAR_NM ,
:NEW.CAR_DT_BE ,
:NEW.CAR_DT_AF ,
:NEW.CAR_POINT ,
:NEW.CAR_POSITION ,
:NEW.USE_YN ,
:NEW.CAR_SORT ,
:NEW.INS_DT ,
:NEW.INS_ID ,
:NEW.UPD_DT ,
:NEW.UPD_ID ,
SYSDATE ,
'U'
);
END IF;

IF DELETING THEN
INSERT INTO MAN_CAREER_LOG
(
AD_ID ,
CAR_SEQ ,
CAR_NM ,
CAR_DT_BE ,
CAR_DT_AF ,
CAR_POINT ,
CAR_POSITION ,
USE_YN ,
CAR_SORT ,
INS_DT ,
INS_ID ,
UPD_DT ,
UPD_ID ,
LOG_UPDATE_DATE,
LOG_UPDATE_MODE
)
VALUES
(
:OLD.AD_ID ,
:OLD.CAR_SEQ ,
:OLD.CAR_NM ,
:OLD.CAR_DT_BE ,
:OLD.CAR_DT_AF ,
:OLD.CAR_POINT ,
:OLD.CAR_POSITION ,
:OLD.USE_YN ,
:OLD.CAR_SORT ,
:OLD.INS_DT ,
:OLD.INS_ID ,
:OLD.UPD_DT ,
:OLD.UPD_ID ,
SYSDATE ,
'D'
);
END IF;
END;
/

728x90

'DB' 카테고리의 다른 글

OALL8이 불일치 상태입니다  (0) 2012.07.29
MySql dmp  (0) 2012.07.29
Oracle Procedure  (0) 2012.07.29
Oracle Function  (0) 2012.07.29
데이터유형  (0) 2012.07.29

+ Recent posts