Hi MY Dear
I have two two table master detail in one page
- CREATE TABLE order_master
- (
- order_id NUMBER,
- order_kind NUMBER,
- from_store_id number,
- to_store_id number,
- order_date DATE
- );
-
-
-
-
- CREATE TABLE order_detail
- (
- ord_detail_id NUMBER,
- order_id NUMBER,
- item_code NUMBER,
- qty NUMBER
- );
scenario is
customer create order with detail at same time
I need to create trigger at two table check in the master table order_master if order_kind =1 " it means Deducted from inventory" take the qty in order detail and check the value from this table
- create table inventory (
- inv_id number,
- store_id number,
- balance number);
if order_kind =1 and qty in order_datail > the balance in inventory then refuese the operation
I cant create trigger at two table and check before insert
thanks in advance