update UNIONMEMBERS 
        set UJOBID := ''  where UNIONID = :old.UNIONID and UJOBID = :old.UJOBID;       update UNIONMEMBERS 
        set UJOBID = ''  where UNIONID = :old.UNIONID and UJOBID = :old.UJOBID;

解决方案 »

  1.   

    下面这句话:update UNIONMEMBERS 
            set UJOBID := ''  where UNIONID = :old.UNIONID and UJOBID = :old.UJOBID;我已改成了
    update UNIONMEMBERS 
            set UJOBID = ''  where UNIONID = :old.UNIONID and UJOBID = :old.UJOBID;但还是出现相同的错误.
    再帮我看看!!!!
      

  2.   

    CREATE OR REPLACE TRIGGER TDU_UNIONSJOB BEFORE
    DELETE or UPDATE OF UJOBID, UNIONID   
        ON UNIONSJOB
        FOR EACH ROW 
     DECLARE I NUMBER;    
    BEGIN
     if deleting then
         select count(*) into i from unions where UNIONID = :old.UNIONID;
         if i>0 then
           update UNIONMEMBERS 
            set UJOBID = ''  where UNIONID = :old.UNIONID and UJOBID = :old.UJOBID;
         else
           delete from UNIONMEMBERS  where UNIONID = :old.UNIONID and UJOBID = :old.UJOBID; 
         end if;
      else
           update UNIONMEMBERS 
            set UNIONID=:new.UNIONID,UJOBID=:new.UJOBID
             where UNIONID = :old.UNIONID and UJOBID = :old.UJOBID; 
      end if;
    end;
    /
      

  3.   

    select i= count(*) from unions where UNIONID = :old.UNIONID可以这么写吗?
    select count(*) into i unions where UNIONID = :old.UNIONID
      

  4.   

    谢谢 fuxia(双子星),zmgowin(hermit) , wfeng7907(无风) ,几个月没摸数据库了,原来都没用过ORACLE,现在学着用,受益非浅啊.