我有一个关于综合触发器的问题。如果有任何事件与过滤器匹配,我使用此触发器发送电子邮件。
这是过滤器:
begin
for each row critical in alerts.status where critical.Severity = 5 and
critical.Grade <= 6 and critical.LastOccurrence <= ( getdate() - (60*30) )
begin
execute send_email( critical.Node, critical.Severity, 'test2@npp.local','Netcool Email', critical.Summary, 'WINITMSVR631');
update alerts.status via critical.Identifier set Grade=7;
end;
end
我成功发送了一封带有上述触发器的电子邮件,
我想在触发器中添加几行,它看起来像这样:
begin
for each row critical in alerts.status where critical.Severity = 5 and
critical.Grade <= 6
if critical.Situation = 'blabla1'
{begin
execute send_email( critical.Node, critical.Severity, 'test2@npp.local','Netcool Email', critical.Summary, 'WINITMSVR631');
update alerts.status via critical.Identifier set Grade=7;
end;}
if critical.Situation = 'blabla2'
{begin
execute send_email2( critical.Node, critical.Severity, 'test2@npp.local', 'Netcool Email', critical.Summary, 'WINITMSVR631');
update alerts.status via critical.Identifier set Grade=7;
end;}
end
但我总是对此有一些错误。老实说,我几乎不知道 sql 编程。
任何建议
谢谢您的帮助