CREATE TABLE DEDUCTION_RESULT
("DEDUCT_ID" NUMBER, "MISSIONARY_ID" VARCHAR2(20),"RECEIPT_NO" NUMBER,"SUPPORTER_ID" NUMBER, "AMOUNT" NUMBER,"CONTRIBUTION_DATE" DATE ,"DEDUCTION" NUMBER )
CREATE SEQUENCE "DEDUCTION_RESULT_SEQ" MINVALUE 1 MAXVALUE 9999999999999999 INCREMENT BY 1 START WITH 100 CACHE 20 NOORDER NOCYCLE
CREATE OR REPLACE TRIGGER "INSERT_DEDUCTION_RESULT"
BEFORE INSERT ON DEDUCTION_RESULT
FOR EACH ROW
DECLARE
DEDUCT_ID_sv number;
SELECT DEDUCTION_RESULT_SEQ.nextval
INTO DEDUCT_ID_sv
FROM dual;
:new.DEDUCT_ID := DEDUCT_ID_sv;
End;