CREATE TRIGGER input_verification AFTER INSERT ON InputHistory
FOR EACH ROW
WHEN NO EXISTS (SELECT * FROM InputHistory JOIN Intput on InputHistory.inputId = Input.inputId WHERE InputHistory.inputId = NEW.inputId AND InputHistory.inputHistoryOrderNumber=Input.inputOrderNumber AND InputHistory.inputHistoryStatus >= 300)
BEGIN
DECLARE configId INTEGER;
SELECT Input.inputConfigurationId INTO configId FROM Input JOIN InputHistory ON Input.inputId = InputHistory.inputId WHERE NEW.inputId=Input.inputId;
UPDATE Configuration SET configurationReady = true WHERE configurationId= configId;
END
暂无答案!
目前还没有任何答案,快来回答吧!