Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Summation
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