I have a bulk stock table with a quantity variable. I also have a quantity variable for a table called purchase order. When a user makes a purchase order I want the quantity they have inserted in the purchase order table to be deleted in the Bulk stock table. I am doing this using an SQL oracle software called Apex. I am struggling with SQL syntax i believe:
Error: ORA-01747: invalid user.table.column, table.column, or column specification
this is my code
UPDATE Bulk_stock
SET Bulk_stock.bulk_quantity = Bulk_stock.bulk_quantity - purchase_order.order_quantity,
WHERE EXISTS
(SELECT 1
FROM purchase_order
WHERE Bulk_stock.stock_id = purchase_order.stock_id);