这个触发器可以做到:
CREATE OR REPLACe TRIGGER trigger_w_subqueryAFTER UPDATE OR INSERT ON project_archivingFOR EACH ROW WHEN (old.archiving_status <> new.archiving_status AND new.archiving_status = 1)DECLARE l_offer projects.offer%TYPE;BEGIN SELECT offer INTO l_offer FROM projects WHERe projnum = :new.projnum; IF l_offer IS NULL THEN INSERT INTO offer_log (offer, status, date) VALUES (null, 9, sysdate); END IF;END;
我假设从项目中进行选择将始终找到一行;如果不是,它将引发您可能需要处理的NO_DATA_FOUND异常。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)