Hello everyone,

im doing a small program where i have a stock table with my Items and the current stock status.

How do i substract from that stock status when i insert a new order in my ordertable.

My tables are:

STOCK:
Item_ID
Stock status

ORDER
Item_FK:
Qty

So i want to make a trigger or stored procedure that substracts Qty from stockstatus based on item_ID when a new row is inserted in my ORDER table.

How to do that??

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.