I need to create a trigger that decreases on a "stocks" table the amount that have been inserted on the "tooken_from_stock" table.
the trigger should be something like:
CREATE TRIGGER triggerdecrease
BEFORE INSERT ON tooken_from_stock
EXECUTE PROCEDURE decrease();
then i need to create the procedure decrease that gets the inserted "tooken_from_stock.amount" and subtracts it on "stocks.amount
"
can anybody help me with this please?
thanks in advance.