读书人

Sql Server触发器转DB2触发器,该怎么处

发布时间: 2013-03-20 15:25:24 作者: rapoo

Sql Server触发器转DB2触发器


CREATE Trigger eTR_Status_UPT
On [dbo].[eStatus]
For Update
As
Begin
If Update(joindate)
Begin
Update a Set a.joindate=b.joindate From Lemployee a,Inserted b Where a.EID=b.EID
Update a Set a.joindate=b.joindate From aemployee a,Inserted b Where a.EID=b.EID
Update a Set a.joindate=b.joindate From cemployee a,Inserted b Where a.EID=b.EID
End

If Update(isPrac)
Begin
Update a Set a.isPrac=b.isPrac From Lemployee a,Inserted b Where a.EID=b.EID
End

If Update(PracTerm)
Begin
Update a Set a.PracTerm=b.PracTerm From Lemployee a,Inserted b Where a.EID=b.EID
End

If Update(PracEnddate)
Begin
Update a Set a.PracEnddate=b.PracEnddate From Lemployee a,Inserted b Where a.EID=b.EID
Update a Set a.PracEnddate=b.PracEnddate From aemployee a,Inserted b Where a.EID=b.EID
Update a Set a.PracEnddate=b.PracEnddate From cemployee a,Inserted b Where a.EID=b.EID
End
End

帮忙改写一下!谢谢!
[解决办法]
我之前的做法就是建4个触发器

读书人网 >IBM DB2

热点推荐