Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> How to write this Trigger ?
I have a table t1.
Create table t1(
CostName Char(10),
Cost Number(12,2) default 0,
AllCost Number(12,2) default 0
);
I Want to use Trigger to set AllCost = sum(Cost) by CostName.
I use "after insert for each row" and get mutating error!
How to write this trigger!
or some better ways to realise this function.
eg:
Insert 'abc',1 the result 'abc',1,1 insert 'abc',2 the result 'abc',1,3
'abc',2,3
insert 'abc',1 the result 'abc',1,4
'abc',2,4
'abc',1,4
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Nov 03 1999 - 08:19:27 CST
![]() |
![]() |