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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -