-- The primary key value is populated by a before insert trigger -- In 11g primary key column value can be directly assigned as -- shown below. CREATE OR REPLACE TRIGGER edw_sales_trans_bi_trig BEFORE INSERT ON edw_sales_detail FOR EACH ROW BEGIN :NEW.sales_tran_id := sales_tran_id_seq.NEXTVAL; END edw_sales_trans_bi_trig; / 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;
24078