plsql - a triggers question in oracle -
i kind of new triggers , cant figure out how resolve this.
after insert new row on specicfic table should influence other tables aswell.
so if add(insert) order on table includes 3 quantity, want 3 less in_stock in table(column)... in advance
assuming column , table names (order table column name : quantity , product_id key uniquely used identify order) .. should job
create or replace trigger trg_update_available after insert on orders each row begin update in_stock set quantity = quantity - :new.quantity product_id = :new.product_id; end; /
note : commit; still present in code insert order.
Comments
Post a Comment