1.student表
stu_id number
stu_applyTime
2。teacher表
t_id
stu_applyTime
3.当修改了student表中的stu_applyTime字段的值时。teacher表中相对应的值也改变
把触发器完整的代码留下。谢谢!

解决方案 »

  1.   

    --应该有个关联的字段吧 学生IDcreate or replace trigger tri_up_stu_applyTime before update on student for each row
    when (new.stu_applyTime<>old.stu_applyTime)
    begin
    update teacher set stu_applyTime=:new.stu_applyTime where stu_applyTime=:old.stu_applyTime and 关联字段;
    end;
      

  2.   

    不好意思。学生表还有一个字段。teacher_id与教师表相关联
      

  3.   

    create or replace trigger "updateJoinTime"
      after insert or update
        of stu_applyTime
        on student
      referencing old as "old_value"
                  new as "new_value"
      for each row
    declare
    begin
    update teacher tt set tt.stu_applyTime = :new where student.teacher_id not is null and tt.id = student.teacher_id ;
    end updateJoinTime;这个是可以用的谢谢大家!!!