create or replace trigger aa 
 after insert on tablexx
 for each row
begin...............;end;

解决方案 »

  1.   

    能不能简单的写一个例子..
    我对Oracle 不是很熟悉!!
      

  2.   

    create or replace trigger aa 
     after insert on tablexx
     for each row
    beginselect * from xxx;end aa;你在begin...end内写你的代码即可
      

  3.   

    举个例子create trigger abc
    after insert
    on jbxx
    for each row
    begin
    insert into jbxxcs(lffh,id) values(:new.lffh,:new.id);
    end;
      

  4.   

    create or replace trigger tri_talbe_a
    begin insert on table_a 
    for each row
    declare
       i  number(4);--計數器
    begin
       select count(*) into i
       from   table_b,table_c
       where  table_b.SN = table_c.SN
       and    table_b.Time = table_c.Time
       and    table_b.time = :new.Time ;
       if i > 0 then
          insert into table_d (
                 sn    ,
                 time  ,
                 a     ,
                 b     ,
                 c     ,
                 d     ,
                 e     ,
                 f     )
          select :new.sn   ,
                 :new.time ,
                 :new.a    ,
                 :new.b    ,
                 table_b.c ,
                 table_b.d ,
                 table_c.e ,
                 table_c.f
          from   table_b,table_c
          where  table_b.SN = table_c.SN
          and    table_b.Time = table_c.Time  
          and    table_b.Time = :new.Time 
          and    rownum = 1 ;
       end if;
    end;
    /
    -------------------------------
    再對B,表做同樣得TRIGGER,隻是將其中得table_b替換為table_a
    再對C,表做同樣得TRIGGER,隻是將其中得table_b替換為table_c
      

  5.   

    CREATE OR REPLACE TRIGGER TG_TABLE_A
    AFTER INSERT ON TABLE_A
    FOR EACH ROW
    BEGIN 
      SELECT SN FROM TABLE_B B,
                     TABLE_C C
        WHERE B.SN = :NEW.SN AND C.SN = :NEW.SN
        AND B.TIME = ;NEW.TIME AND C.TIME = :NEW.TIME
    AND ROWNUM = 1;
      IF SQL%FOUND THEN 
         INSERT INTO TABLE_D (SN,TIME,A,B,C,D)
            select :new.sn   ,
                 :new.time ,
                 :new.a    ,
                 :new.b    ,
                 table_b.c ,
                 table_b.d ,
                 table_c.e ,
                 table_c.f
          from   table_b,table_c
          where  table_b.SN = table_c.SN
          and    table_b.Time = table_c.Time  
          and    table_b.Time = :new.Time 
          and    rownum = 1 ;
      END IF;
    END;