-- The primary key value is populated by a before insert trigger CREATE OR REPLACE TRIGGER edw_sales_trans_bi_trig BEFORE INSERT ON edw_sales_detail FOR EACH ROW BEGIN SELECT sales_tran_id_seq.NEXTVAL INTO :NEW.sales_tran_id FROM DUAL; END edw_sales_trans_bi_trig; / -- The data insert excludes the primary key INSERT ALL INTO edw_sales_detail(loc_id, cust_id, invoice_num, invoice_date, sales_amt, tax_amt, freight_amt) VALUES (1, 10, '1001', SYSDATE, 1000.00, 50.00, 15.00) INTO edw_sales_detail(loc_id, cust_id, invoice_num, invoice_date, sales_amt, tax_amt, freight_amt) VALUES (2, 11, '1002', SYSDATE, 2000.00, 75.00, 25.00) SELECT * FROM DUAL; COMMIT;
54962