CREATE EVENT IF NOT EXISTS paytime_test
ON SCHEDULE
every 1 minute
ON COMPLETION NOT PRESERVE
ENABLE
COMMENT '결재'
DO
update reservation set useyn = 'N'
where DATE_ADD(logdate, INTERVAL 5 MINUTE) < now() and useyn = 'Y' and payyn = 'N';
SHOW EVENTS;
DROP EVENT staygs.paytime;
DELIMITER $$
CREATE TRIGGER payupdate
BEFORE INSERT ON payment
FOR EACH ROW
BEGIN
DECLARE idTemp VARCHAR(32);
DECLARE answerTemp VARCHAR(32);
SET idTemp = NEW.merchant_uid;
SET answerTemp = new.status;
if answerTemp = 'DONE' then
UPDATE reservation set payyn = 'Y', useyn = 'Y' where merchant_uid = idTemp;
elseif answerTemp = 'CANCELED' then
UPDATE reservation set payyn = 'N', useyn = 'N' where merchant_uid = idTemp;
end if;
END $$
DELIMITER ;
SHOW TRIGGERS;
Drop Trigger payupdate;
'IT 개발일지' 카테고리의 다른 글
C# datatable을 활용한 datagridview 컬럼 셋팅하기 (0) | 2024.10.14 |
---|---|
Windows 10 멈춤 현상(프리징) 해결 방법: 간단한 설정 조정으로 안정성 확보하기 (0) | 2024.08.12 |
C# 데이터그리드뷰 행 삭제 How to Delete Rows in a DataGridView with a Boundin Data Source in WinForms: A Step-by-Step Guide with Code Snippets (0) | 2023.05.15 |
C# datagrid에 checkbox 삽입 하기 (0) | 2023.01.10 |
C# OleDb를 이용하여 엑셀파일 불러와서 내용 출력 (0) | 2022.12.30 |
댓글