create trigger update_checking
   before update on check_body
   for each row
begin
   if new.high>2 then
      new.high:=old.high;
      raise_application_error(-10345,'He(or She) is too tall');
   end if;
   if new.weight>100 then
      new.weight:=old.weight;
      raise_application_error(-10346,'He(or She) is too fat');
   end if;
end update_checking;

解决方案 »

  1.   

    create trigger update_checking
     after update on check_body
     for each row
     begin
     if new.high>2 then
        new.high := :old.high;--出现new和old的时候要用‘:’;
        raise_application_error(-10345,'He(or She) is too tall');
     end if;
     if new.weight>100 then
        new.weight := :old.weight;
        raise_application_error(-10346,'He(or She) is too fat');
     end if;
     end update_checking;
      

  2.   

    你可要看清楚,然后再运行一下看看有没有问题再说,
    我是把你的after 改成了 before,这两个谓词肯定是有区别的。
      

  3.   

    连我都看出来了,你的是第二句是:after update on check_body。
    楼上师兄把你的改成了:before update on check_bodyUP!
      

  4.   

    2点错误:1、编译错误是由new和old的时候要用‘:’产生的!2、然后泥的after应该改为before,这样才能实现泥的要求~
      

  5.   

    create trigger update_checking
     after update on check_body
     for each row
     begin
     if :new.high>2 then
        :new.high := :old.high;--出现new和old的时候要用‘:’;
        raise_application_error(-10345,'He(or She) is too tall');
     end if;
     if :new.weight>100 then
        :new.weight := :old.weight;
        raise_application_error(-10346,'He(or She) is too fat');
     end if;
     end update_checking;
    我已经调试过了,可以的,你把你执行的语句和错误贴出来看看!
      

  6.   

    试过楼上的后,如果还有问题的话,再试试这个吧!
    create trigger update_checking
       before update on check_body
       for each row
    begin
       if :new.high>2 then
          :new.high:=:old.high;
          raise_application_error(-10345,'He(or She) is too tall');
       end if;
       if :new.weight>100 then
          :new.weight:=:old.weight;
          raise_application_error(-10346,'He(or She) is too fat');
       end if;
    end update_checking;
    如果还有编译错误,那就
    SQL>show errors    --查看详细错误