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: Sum of Details on Master

Re: Sum of Details on Master

From: Keystroke <keystrk_at_feist.com>
Date: 1997/03/29
Message-ID: <333c795a.857374@news.feist.com>#1/1

On Fri, 28 Mar 97 10:59:22 GMT, nbroucke_at_be.oracle.com (Nico Vandenbroucke) wrote:

>Any1 who knows how to handle this problem?
>
>The database holds two tables ('INVOICE' (master) and 'INVOICELINE' (detail)).
>Every Invoice line has an amount.
>
>We would like to keep the total amount of the invoice lines in the Invoice
>table.

Why wouldn't you be able to put the following SQL in both the trigger and the Form?

Update user.invoice i set
  line_summ =
(select sum(il.line_amt)
  from user.invoice_line il
  where i.invoice_no = il.invoice_no
    and il.invoice_no = :some_parameter) ;

That way, no matter who 'gets' to the invoice row last, the total will be correct. Received on Sat Mar 29 1997 - 00:00:00 CST

Original text of this message

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