是否可以在不調用回滾的情況下進行SIGNAL(即,是否存在不引起回滾的SQLSTATE),還是SIGNAL自動推斷回滾?是否可以在不調用回滾的情況下進行SIGNAL?在db2上?
我有一個查詢
CREATE TRIGGER DEAD_TRAILERS_NOTIFY
AFTER UPDATE OF TRAILER ON TRIP
REFERENCING NEW AS N OLD AS O
FOR EACH ROW
BEGIN ATOMIC
DECLARE DEAD_SAT VARCHAR(10);
DECLARE MSG VARCHAR(70);
SET DEAD_SAT = COALESCE((SELECT TRAILER_ID FROM TRAILER WHERE LAST_SAT_DATE < CURRENT TIMESTAMP - 8 DAYS AND N.TRAILER = TRAILER_ID),'OK');
IF DEAD_SAT <> 'OK' AND USER NOT IN ('VISTAR','TM4WIN') THEN
SET MSG = 'SAT ON TRAILER IS DEAD. PLEASE GET IT REPLACED';
SIGNAL SQLSTATE '90001' SET MESSAGE_TEXT = MSG;
END IF;
END
唯一的問題是,如果它不能滿足它捲回數據觸發。有沒有這樣做的SQL狀態或全部都做?
謝謝你的回答,但它仍在回滾數據。 – OVO