<P>A表有学生基本信息(studntnum  xueji 等)</P> <P>B表是更改学生学籍的,有(studentnum ,xueji 等)</P> <P>现在我向B表添加一条记录,目的是更改某学生学籍,所以A表中相应学生的xueji项应该和添加在B表中的 xueji一样,用触发器怎么写呢?</P>
                    
                    
                2 回答
 
                    
                    
                            温温酱
                            
                                
                            
                        
                        
                                                
                    TA贡献1752条经验 获得超4个赞
create or replace trigger B_AFTER_ALL after insert or update or delete on B for each row declare strTableName varchar(32) := 'B'; strValues varchar(256); strPrimaryKeys varchar(256); begin if UPDATING then strValues :='xueji='||:new.xueji; strPrimaryKeys := 'STUDENTNUM='||:new.STUDENTNUM; update A set strValues where strPrimaryKeys; end if; exception when others then null; end B_AFTER_ALL; /
- 2 回答
- 0 关注
- 386 浏览
添加回答
举报
0/150
	提交
		取消
	