Skip to content
Advertisement

How can I modify the trigger and make sure that the trigger runs properly to increase the OrderTotal value

For this situation I want to create the trigger and make sure that the trigger is executed after the insertion of the PurchaseOrderDetail record to increase the orderTotal in the PurchaseOrder table after each purchaseOrderDetail record is inserted.

This is my PurchaseOrder Table

And this is my PurchaseOrderDetail Table

This is the data for inserting

And this is the trigger that I created:

But the trigger cannot be executed and shows “Warning:trigger created with compilation errors” error , how can I fix the trigger to run it properly?

Advertisement

Answer

You should use the :NEW as follows:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement