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

Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger with diferent tables

Re: Trigger with diferent tables

From: Valentin Minzatu <valentinminzatu_at_yahoo.com>
Date: 28 Feb 2007 07:26:23 -0800
Message-ID: <1172676383.794683.16390@m58g2000cwm.googlegroups.com>


On Feb 28, 3:49 am, a..._at_bibiano.es wrote:
> I have 2 tables with a master/detail relationship (delivery note
> header and detail)
>
> Now I want to do a trigger to update the stock table. In the delivery
> note header table I have the warehouse and in the detail I have the
> quantity sent and the article code.
>
> I thing I have to do 2 triggers, one for the delivery note header to
> update stock when the warehouse change, and another trigger in the
> detail table (for update, delete and insert). I'm not very expert in
> Oracle trigger programming. Can somebody give me an approach to do it?
> Can I reference the delivery note header table from the detail table
> trigger if there are in the same transaction inserted?
>
> A lot of thanks,
>
> Alex B.

I would put the trigger on the detail table (the one which contains the quantiy) as I would only want to do something if there is a change in quantity (i.e. reduce stock). You can read the values you are interested into from the master table whether they are or not updated within the same transaction. Received on Wed Feb 28 2007 - 09:26:23 CST

Original text of this message

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