Re: Trigger Code

From: Odd Morten Sve?s <odd.morten.sveas_at_accenture.com>
Date: 21 Mar 2004 12:50:33 -0800
Message-ID: <4306a83.0403211250.5489bcea_at_posting.google.com>


"Redd" <javatek?_at_usa.com> wrote in message news:<Sj67c.58974$xL3.40979_at_bignews1.bellsouth.net>...
> > I am trying to implement a trigger to update a field and
> > these are the columns.
> >
> >
> > Quantity Integer
> > OldQuantity Integer
> > OnOrder Char
> >
> >
> > Does anyone know how to write the trigger that on update
> > if Quantity is equal to or less than OldQuantity write the
> > Character "T" to the OnOrder field.
> >

Hi

An examle:

create or replace trigger <trigger_name> before update one <table_name>
for each row -- This is due to process every row individualy, an be able to use

  • the :new and :old bind vaialbles begin if :new.Quantity <= :new.OldQuantity then :new.OnOrder := 'T'; end if; end; /

Regards
Odd M Received on Sun Mar 21 2004 - 21:50:33 CET

Original text of this message