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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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