首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > IBM DB2 >

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

2013-03-20 
Sql Server触发器转DB2触发器CREATE Trigger eTR_Status_UPTOn [dbo].[eStatus]For UpdateAsBeginIf Updat

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个触发器

热点排行