WantsToLearn
Programmer
I've read about triggers several times but now need to actually create one. Here is the scenario:
1. Receiving user pulls up PO Receiving form and enters qty received as appropriate for each detail line of the PO
2. When form is complete they click Update button and their entries are inserted into POReceipts detail table
3. I need to update Products table Qty_On_Hand with corresponding values from POReceipts detail table
I have the following questions:
1. Do I need to include commit and rollback logic in case it bombs in the middle
2. If I set up an Insert trigger on POReceipts then how do I pass that data to Products within the Update query (eg in the Update Products Qty_On_Hand Where Product_ID = , etc)
3. One of the threads I searched on before posting mentioned ensuring you handle the bulk insert situation in case something changes down the road - What is the best way to do that
Thanks for any ideas and/or suggestions.
1. Receiving user pulls up PO Receiving form and enters qty received as appropriate for each detail line of the PO
2. When form is complete they click Update button and their entries are inserted into POReceipts detail table
3. I need to update Products table Qty_On_Hand with corresponding values from POReceipts detail table
I have the following questions:
1. Do I need to include commit and rollback logic in case it bombs in the middle
2. If I set up an Insert trigger on POReceipts then how do I pass that data to Products within the Update query (eg in the Update Products Qty_On_Hand Where Product_ID = , etc)
3. One of the threads I searched on before posting mentioned ensuring you handle the bulk insert situation in case something changes down the road - What is the best way to do that
Thanks for any ideas and/or suggestions.