Error 1064 in Creating a Trigger
I have 2 tables. PurchaseOrder that records all the sale transaction and Products that contains all products and stock. I want to create a trigger to decrease the stock in Products after inserting a sale in PurchaseOrder. Here is my trigger that gets an error. Please help me! Qty is the column of ordered quantity in table PurchaseOrder. Both table has Product_Id field.
create trigger updateStock
after insert on KS_PurchaseOrders
for each row
begin
update KS_Products set Product_StockLevel= Product_StockLevel - new.Qty
where Product_Id =new.Product_Id
end
Subject
Written By
Posted
Error 1064 in Creating a Trigger
January 09, 2024 08:50PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.