Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How to create trigger after update on the simple slide

How to create trigger after update on the simple slide

From: Krista <ywanip_at_gmail.com>
Date: Sun, 21 Oct 2007 18:41:57 -0700
Message-ID: <1193017317.584469.269100@e34g2000pro.googlegroups.com>


Hi everyone,

I am practice on create trigger in Oracle. I found some simples online and tried to put it in my computer. However, it pops up an error messge "warning: trigger created with compilation errors."

Question: we want the net worth of any executive to be below $50000.

First i created the table:
create table movieexce(name varchar2(50) primary key, address varchar2(50), networth number(9,2));

Second i tried to create trigger: ( actually, i put the same thing on the net to test it)
create or replace trigger avgnetworthafterupdate after update of networth on movieexce
referencing

    old as oldstuff
    new as newstuff
begin
if (50000>(select avg(networth) from movieexce)) then

    delete from movieexce where (name, address, networth) in newstuff;     insert into movieexce (select * from oldstuff); end if;
end avgnetworthafterupdate;
/
Result:warning: trigger created with compilation errors.

any one has clue what is wrong with that trigger?

Thanks,
Krista Received on Sun Oct 21 2007 - 20:41:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US