下面是我需要根据条件域id = parent
自动更新的表如果购买日期已更新,则更新触发器将触发并更新域ID 101,102。 我正在使用下面的触发器,但没有成功。我该如何解决?
Create Trigger Domain_U
AFTER UPDATE ON DOMAIN REFERENCING NEW AS NEW_ROW
WHEN (PARENT IS NOT NULL)
Begin Atomic
If Domain id = Parent Then
Update Domain Set PurchaseDate=New_Row.PurchaseDate WHERE STATE='ACTIVE'
End If;
END
示例输入数据:
DOMAINID DOMAINNAME EXPIRYDATE IP PURCHASEDATE PARENT STATE
100 www.rida.com 2015-08-05 10.20.222.1 2015-01-05 ACTIVE
101 www.ridatab.com 10.20.222.2 100 ACTIVE
102 www.grt.com 10.0.222.3 100 ACTIVE