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 -> Re: Summation

Re: Summation

From: Mark Rosenbaum <mjr_at_netcom.com>
Date: 1997/03/23
Message-ID: <mjrE7H5py.ML6@netcom.com>#1/1

In article <33343A64.1BC7_at_triax.com>,
Randy A. Stebbins <Randys_at_triax.com> wrote:
>You waBrice Toth wrote:
>>
>> Hi. I'm relatively new to Oracle and SQL. My question
>> is this: I have a table with columns x and y which are
>> both integer values. i need to get the sum of the values
>> in x and in y to put into column z. i need the sum to
>> occur automatically whenever the values in x and y change.
>> Can anyone help as to how to do this? Thanks a lot.
>>
>> Brice Toth
>> bat107_at_psu.edu
>
>You want to create an update trigger for the table--a "for each row"
>trigger which sets :new.z := :new.x + :new.y

You might also try creating a view where column z is columns x+y of the base table. Received on Sun Mar 23 1997 - 00:00:00 CST

Original text of this message

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