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 -> triger begginer

triger begginer

From: rk <rok_at_softhome.net>
Date: Tue, 6 Apr 2004 21:44:31 +0200
Message-ID: <yMDcc.431$37.59373@news.siol.net>


Hi
Well I'm trying to make simple trigger, when updating tableA.qty I just want to calculate with record from tableB.price and record from tableA.qty and write result in tableA.amount.

PROMPT Creating Trigger 'IZRACUN_IZPLACILA' CREATE OR REPLACE TRIGGER Calculate_amount  AFTER UPDATE OF QTY
 ON TABLE_A
 FOR EACH ROW
 WHEN (NOT(new.QTY = old.QTY)

 DECLARE
  pPRICE NUMBER;

--this I think it works - just getting value from
--TABLE_B.price

   SELECT price INTO pPRICE
   FROM TABLE_B, TABLE_C
   WHERE TABLE_C.idC = :old.C_id
   AND TABLE_C.B_id=TABLE_B.idB;

  END IF; -- updating
END; Thx a lot
RK Received on Tue Apr 06 2004 - 14:44:31 CDT

Original text of this message

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