create trigger dec_num
after insert on sales
For each row mode db2sql
update product set pro_qty = pro_qty - 1
where EXISTS (select product.pro_id from sales,product where product.pro_id = sales.pro_id);
insert into sales values ('s1',1.34,'2010-8-1','m1','p1h1','h1');
after insert data into sales table all pro_qty form product table decrement by 1
Hi . i have to table sales and product . table product has field pro_id and pro_name and pro_qty ,and table sales has sal_id and pro_id(foreign key) . i want pro_qty in table product decrement by one when one item insert into table sales.