move the when clause to the create portion of the
create trigger syntax:
CREATE or REPLACE TRIGGER trg_alt_his_update
AFTER INSERT or UPDATE on alt
FOR EACH ROW
when (new.status not in 6)
begin
trigger body
end;
/
- Ravindra Basavaraja <ravindra_at_sentica.com> wrote:
> I am trying to write a database trigger that should
> fire on update of a
> table
> and when the new value in a column is not equal to
> 6.
>
> CREATE or REPLACE TRIGGER trg_alt_his_update
> AFTER INSERT or UPDATE on alt
> FOR EACH ROW
> BEGIN
> insert into alt_his
>
>
values(:new.id,:new.status,:new.not,:new.update_time,
> :new.sub) ;
> END;
>
> I want this trigger to fire only when the new value
> of status is not equal
> to 6.
> Where can i put in the WHEN clause.
>
> It doesn't with
> insert into alt_his
>
>
values(:new.id,:new.status,:new.not,:new.update_time,
> :new.sub) WHEN :new.status NOT IN 6;
> i get compilation error.
>
> can anyone tell me how to get it work.
>
> Thanks.
>
> Ravindra
>
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> --
> Author: Ravindra Basavaraja
> INET: ravindra_at_sentica.com
>
> Fat City Network Services -- (858) 538-5051 FAX:
> (858) 538-5051
> San Diego, California -- Public Internet
> access / Mailing Lists
>
> To REMOVE yourself from this mailing list, send an
> E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of
> 'ListGuru') and in
> the message BODY, include a line containing: UNSUB
> ORACLE-L
> (or the name of mailing list you want to be removed
> from). You may
> also send the HELP command for other information
> (like subscribing).
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
Received on Thu Dec 14 2000 - 12:43:21 CST